forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#87194 - eddyb:const-value-mangling, r=michael…
…woerister,oli-obk rustc_symbol_mangling: support structural constants and &str in v0. This PR should unblock rust-lang#85530 (except for float `const` generics, which AFAIK should've never worked). (cc `@tmiasko` could the rust-lang#85530 (comment) failures be retried with a quick crater "subset" run of this PR + changing the default to `v0`? Just to make sure I didn't miss anything other than the floats) The encoding is the one suggested before in e.g. rust-lang#61486 (comment), tho this PR won't by itself finish rust-lang#61486, before closing that we'd likely want to move to `@oli-obk's` "valtrees" (i.e. rust-lang#83234 and other associated work). <hr> **EDITs**: 1. switched unit/tuple/braced-with-named-fields `<const-fields>` prefixes from `"u"`/`"T"`/`""` to `"U"`/`"T"`/`"S"` to avoid the ambiguity reported by `@tmiasko` in rust-lang#87194 (comment). 2. `rustc-demangle` PR: rust-lang/rustc-demangle#55 3. RFC amendment PR: rust-lang/rfcs#3161 * also removed the grammar changes included in that PR, from this description 4. added tests (temporarily using my fork of `rustc-demangle`) <hr> r? `@michaelwoerister`
- Loading branch information
Showing
21 changed files
with
609 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/issue-47429-short-backtraces.run.stderr → ...-47429-short-backtraces.legacy.run.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/test/ui/panics/issue-47429-short-backtraces.v0.run.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:21:5 | ||
stack backtrace: | ||
0: std::panicking::begin_panic::<&str> | ||
1: issue_47429_short_backtraces::main | ||
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
// build-fail | ||
// compile-flags: -Z symbol-mangling-version=v0 | ||
// compile-flags: -Z symbol-mangling-version=v0 --crate-name=c | ||
#![feature(rustc_attrs)] | ||
|
||
pub struct Unsigned<const F: u8>; | ||
|
||
#[rustc_symbol_name] | ||
//~^ ERROR symbol-name(_RMCsaP8qXevlYG3_25const_generics_demanglingINtB0_8UnsignedKhb_E) | ||
//~| ERROR demangling(<const_generics_demangling[7e153590edc26969]::Unsigned<11: u8>>) | ||
//~| ERROR demangling-alt(<const_generics_demangling::Unsigned<11>>) | ||
//~^ ERROR symbol-name(_RMCsno73SFvQKx_1cINtB0_8UnsignedKhb_E) | ||
//~| ERROR demangling(<c[464da6a86cb672f]::Unsigned<11u8>>) | ||
//~| ERROR demangling-alt(<c::Unsigned<11>>) | ||
impl Unsigned<11> {} | ||
|
||
pub struct Signed<const F: i16>; | ||
|
||
#[rustc_symbol_name] | ||
//~^ ERROR symbol-name(_RMs_CsaP8qXevlYG3_25const_generics_demanglingINtB2_6SignedKsn98_E) | ||
//~| ERROR demangling(<const_generics_demangling[7e153590edc26969]::Signed<-152: i16>>) | ||
//~| ERROR demangling-alt(<const_generics_demangling::Signed<-152>>) | ||
//~^ ERROR symbol-name(_RMs_Csno73SFvQKx_1cINtB2_6SignedKsn98_E) | ||
//~| ERROR demangling(<c[464da6a86cb672f]::Signed<-152i16>>) | ||
//~| ERROR demangling-alt(<c::Signed<-152>>) | ||
impl Signed<-152> {} | ||
|
||
pub struct Bool<const F: bool>; | ||
|
||
#[rustc_symbol_name] | ||
//~^ ERROR symbol-name(_RMs0_CsaP8qXevlYG3_25const_generics_demanglingINtB3_4BoolKb1_E) | ||
//~| ERROR demangling(<const_generics_demangling[7e153590edc26969]::Bool<true: bool>>) | ||
//~| ERROR demangling-alt(<const_generics_demangling::Bool<true>>) | ||
//~^ ERROR symbol-name(_RMs0_Csno73SFvQKx_1cINtB3_4BoolKb1_E) | ||
//~| ERROR demangling(<c[464da6a86cb672f]::Bool<true>>) | ||
//~| ERROR demangling-alt(<c::Bool<true>>) | ||
impl Bool<true> {} | ||
|
||
pub struct Char<const F: char>; | ||
|
||
#[rustc_symbol_name] | ||
//~^ ERROR symbol-name(_RMs1_CsaP8qXevlYG3_25const_generics_demanglingINtB3_4CharKc2202_E) | ||
//~| ERROR demangling(<const_generics_demangling[7e153590edc26969]::Char<'∂': char>>) | ||
//~| ERROR demangling-alt(<const_generics_demangling::Char<'∂'>>) | ||
//~^ ERROR symbol-name(_RMs1_Csno73SFvQKx_1cINtB3_4CharKc2202_E) | ||
//~| ERROR demangling(<c[464da6a86cb672f]::Char<'∂'>>) | ||
//~| ERROR demangling-alt(<c::Char<'∂'>>) | ||
impl Char<'∂'> {} | ||
|
||
fn main() {} |
Oops, something went wrong.