mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +00:00
Add test for const generics demangling
This commit is contained in:
parent
2b9d22d3a9
commit
a797801532
38
src/test/ui/symbol-names/const-generics-demangling.rs
Normal file
38
src/test/ui/symbol-names/const-generics-demangling.rs
Normal file
@ -0,0 +1,38 @@
|
||||
// build-fail
|
||||
// compile-flags: -Z symbol-mangling-version=v0
|
||||
|
||||
#![feature(min_const_generics, rustc_attrs)]
|
||||
|
||||
pub struct Unsigned<const F: u8>;
|
||||
|
||||
#[rustc_symbol_name]
|
||||
//~^ ERROR symbol-name(_RMCs4fqI2P2rA04_25const_generics_demanglingINtB0_8UnsignedKhb_E)
|
||||
//~| ERROR demangling(<const_generics_demangling[317d481089b8c8fe]::Unsigned<11: u8>>)
|
||||
//~| ERROR demangling-alt(<const_generics_demangling::Unsigned<11>>)
|
||||
impl Unsigned<11> {}
|
||||
|
||||
pub struct Signed<const F: i16>;
|
||||
|
||||
#[rustc_symbol_name]
|
||||
//~^ ERROR symbol-name(_RMs_Cs4fqI2P2rA04_25const_generics_demanglingINtB2_6SignedKsn98_E)
|
||||
//~| ERROR demangling(<const_generics_demangling[317d481089b8c8fe]::Signed<-152: i16>>)
|
||||
//~| ERROR demangling-alt(<const_generics_demangling::Signed<-152>>)
|
||||
impl Signed<-152> {}
|
||||
|
||||
pub struct Bool<const F: bool>;
|
||||
|
||||
#[rustc_symbol_name]
|
||||
//~^ ERROR symbol-name(_RMs0_Cs4fqI2P2rA04_25const_generics_demanglingINtB3_4BoolKb1_E)
|
||||
//~| ERROR demangling(<const_generics_demangling[317d481089b8c8fe]::Bool<true: bool>>)
|
||||
//~| ERROR demangling-alt(<const_generics_demangling::Bool<true>>)
|
||||
impl Bool<true> {}
|
||||
|
||||
pub struct Char<const F: char>;
|
||||
|
||||
#[rustc_symbol_name]
|
||||
//~^ ERROR symbol-name(_RMs1_Cs4fqI2P2rA04_25const_generics_demanglingINtB3_4CharKc2202_E)
|
||||
//~| ERROR demangling(<const_generics_demangling[317d481089b8c8fe]::Char<'∂': char>>)
|
||||
//~| ERROR demangling-alt(<const_generics_demangling::Char<'∂'>>)
|
||||
impl Char<'∂'> {}
|
||||
|
||||
fn main() {}
|
74
src/test/ui/symbol-names/const-generics-demangling.stderr
Normal file
74
src/test/ui/symbol-names/const-generics-demangling.stderr
Normal file
@ -0,0 +1,74 @@
|
||||
error: symbol-name(_RMCs4fqI2P2rA04_25const_generics_demanglingINtB0_8UnsignedKhb_E)
|
||||
--> $DIR/const-generics-demangling.rs:8:1
|
||||
|
|
||||
LL | #[rustc_symbol_name]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: demangling(<const_generics_demangling[317d481089b8c8fe]::Unsigned<11: u8>>)
|
||||
--> $DIR/const-generics-demangling.rs:8:1
|
||||
|
|
||||
LL | #[rustc_symbol_name]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: demangling-alt(<const_generics_demangling::Unsigned<11>>)
|
||||
--> $DIR/const-generics-demangling.rs:8:1
|
||||
|
|
||||
LL | #[rustc_symbol_name]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: symbol-name(_RMs_Cs4fqI2P2rA04_25const_generics_demanglingINtB2_6SignedKsn98_E)
|
||||
--> $DIR/const-generics-demangling.rs:16:1
|
||||
|
|
||||
LL | #[rustc_symbol_name]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: demangling(<const_generics_demangling[317d481089b8c8fe]::Signed<-152: i16>>)
|
||||
--> $DIR/const-generics-demangling.rs:16:1
|
||||
|
|
||||
LL | #[rustc_symbol_name]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: demangling-alt(<const_generics_demangling::Signed<-152>>)
|
||||
--> $DIR/const-generics-demangling.rs:16:1
|
||||
|
|
||||
LL | #[rustc_symbol_name]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: symbol-name(_RMs0_Cs4fqI2P2rA04_25const_generics_demanglingINtB3_4BoolKb1_E)
|
||||
--> $DIR/const-generics-demangling.rs:24:1
|
||||
|
|
||||
LL | #[rustc_symbol_name]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: demangling(<const_generics_demangling[317d481089b8c8fe]::Bool<true: bool>>)
|
||||
--> $DIR/const-generics-demangling.rs:24:1
|
||||
|
|
||||
LL | #[rustc_symbol_name]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: demangling-alt(<const_generics_demangling::Bool<true>>)
|
||||
--> $DIR/const-generics-demangling.rs:24:1
|
||||
|
|
||||
LL | #[rustc_symbol_name]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: symbol-name(_RMs1_Cs4fqI2P2rA04_25const_generics_demanglingINtB3_4CharKc2202_E)
|
||||
--> $DIR/const-generics-demangling.rs:32:1
|
||||
|
|
||||
LL | #[rustc_symbol_name]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: demangling(<const_generics_demangling[317d481089b8c8fe]::Char<'∂': char>>)
|
||||
--> $DIR/const-generics-demangling.rs:32:1
|
||||
|
|
||||
LL | #[rustc_symbol_name]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: demangling-alt(<const_generics_demangling::Char<'∂'>>)
|
||||
--> $DIR/const-generics-demangling.rs:32:1
|
||||
|
|
||||
LL | #[rustc_symbol_name]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 12 previous errors
|
||||
|
Loading…
Reference in New Issue
Block a user