diff --git a/src/test/ui/symbol-names/const-generics-str-demangling.rs b/src/test/ui/symbol-names/const-generics-str-demangling.rs new file mode 100644 index 00000000000..af111dd39fa --- /dev/null +++ b/src/test/ui/symbol-names/const-generics-str-demangling.rs @@ -0,0 +1,44 @@ +// build-fail +// compile-flags: -Z symbol-mangling-version=v0 --crate-name=c +#![feature(const_generics, rustc_attrs)] +#![allow(incomplete_features)] + +pub struct Str; + +#[rustc_symbol_name] +//~^ ERROR symbol-name(_RMCsno73SFvQKx_1cINtB0_3StrKRe616263_E) +//~| ERROR demangling(>) +//~| ERROR demangling-alt(>) +impl Str<"abc"> {} + +#[rustc_symbol_name] +//~^ ERROR symbol-name(_RMs_Csno73SFvQKx_1cINtB2_3StrKRe27_E) +//~| ERROR demangling(>) +//~| ERROR demangling-alt(>) +impl Str<"'"> {} + +#[rustc_symbol_name] +//~^ ERROR symbol-name(_RMs0_Csno73SFvQKx_1cINtB3_3StrKRe090a_E) +//~| ERROR demangling(>) +//~| ERROR demangling-alt(>) +impl Str<"\t\n"> {} + +#[rustc_symbol_name] +//~^ ERROR symbol-name(_RMs1_Csno73SFvQKx_1cINtB3_3StrKRee28882c3bc_E) +//~| ERROR demangling(>) +//~| ERROR demangling-alt(>) +impl Str<"∂ü"> {} + +#[rustc_symbol_name] +//~^ ERROR symbol-name(_RMs2_Csno73SFvQKx_1cINtB3_3StrKRee183a1e18390e183ade1839be18394e1839ae18390e183935fe18392e18394e1839be183a0e18398e18394e1839ae183985fe183a1e18390e18393e18398e1839ae18398_E) +//~| ERROR demangling(>) +//~| ERROR demangling-alt(>) +impl Str<"საჭმელად_გემრიელი_სადილი"> {} + +#[rustc_symbol_name] +//~^ ERROR symbol-name(_RMs3_Csno73SFvQKx_1cINtB3_3StrKRef09f908af09fa688f09fa686f09f90ae20c2a720f09f90b6f09f9192e29895f09f94a520c2a720f09fa7a1f09f929bf09f929af09f9299f09f929c_E) +//~| ERROR demangling(>) +//~| ERROR demangling-alt(>) +impl Str<"🐊🦈🦆🐮 § 🐶👒☕🔥 § 🧡💛💚💙💜"> {} + +fn main() {} diff --git a/src/test/ui/symbol-names/const-generics-str-demangling.stderr b/src/test/ui/symbol-names/const-generics-str-demangling.stderr new file mode 100644 index 00000000000..f401997017f --- /dev/null +++ b/src/test/ui/symbol-names/const-generics-str-demangling.stderr @@ -0,0 +1,110 @@ +error: symbol-name(_RMCsno73SFvQKx_1cINtB0_3StrKRe616263_E) + --> $DIR/const-generics-str-demangling.rs:8:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: demangling(>) + --> $DIR/const-generics-str-demangling.rs:8:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: demangling-alt(>) + --> $DIR/const-generics-str-demangling.rs:8:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: symbol-name(_RMs_Csno73SFvQKx_1cINtB2_3StrKRe27_E) + --> $DIR/const-generics-str-demangling.rs:14:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: demangling(>) + --> $DIR/const-generics-str-demangling.rs:14:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: demangling-alt(>) + --> $DIR/const-generics-str-demangling.rs:14:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: symbol-name(_RMs0_Csno73SFvQKx_1cINtB3_3StrKRe090a_E) + --> $DIR/const-generics-str-demangling.rs:20:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: demangling(>) + --> $DIR/const-generics-str-demangling.rs:20:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: demangling-alt(>) + --> $DIR/const-generics-str-demangling.rs:20:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: symbol-name(_RMs1_Csno73SFvQKx_1cINtB3_3StrKRee28882c3bc_E) + --> $DIR/const-generics-str-demangling.rs:26:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: demangling(>) + --> $DIR/const-generics-str-demangling.rs:26:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: demangling-alt(>) + --> $DIR/const-generics-str-demangling.rs:26:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: symbol-name(_RMs2_Csno73SFvQKx_1cINtB3_3StrKRee183a1e18390e183ade1839be18394e1839ae18390e183935fe18392e18394e1839be183a0e18398e18394e1839ae183985fe183a1e18390e18393e18398e1839ae18398_E) + --> $DIR/const-generics-str-demangling.rs:32:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: demangling(>) + --> $DIR/const-generics-str-demangling.rs:32:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: demangling-alt(>) + --> $DIR/const-generics-str-demangling.rs:32:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: symbol-name(_RMs3_Csno73SFvQKx_1cINtB3_3StrKRef09f908af09fa688f09fa686f09f90ae20c2a720f09f90b6f09f9192e29895f09f94a520c2a720f09fa7a1f09f929bf09f929af09f9299f09f929c_E) + --> $DIR/const-generics-str-demangling.rs:38:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: demangling(>) + --> $DIR/const-generics-str-demangling.rs:38:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: demangling-alt(>) + --> $DIR/const-generics-str-demangling.rs:38:1 + | +LL | #[rustc_symbol_name] + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 18 previous errors +