Skip to content

Commit

Permalink
tests: add v0 &str const value demangling test.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Aug 24, 2021
1 parent f8810ee commit af002c1
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/test/ui/symbol-names/const-generics-str-demangling.rs
Original file line number Diff line number Diff line change
@@ -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<const S: &'static str>;

#[rustc_symbol_name]
//~^ ERROR symbol-name(_RMCsno73SFvQKx_1cINtB0_3StrKRe616263_E)
//~| ERROR demangling(<c[464da6a86cb672f]::Str<"abc">>)
//~| ERROR demangling-alt(<c::Str<"abc">>)
impl Str<"abc"> {}

#[rustc_symbol_name]
//~^ ERROR symbol-name(_RMs_Csno73SFvQKx_1cINtB2_3StrKRe27_E)
//~| ERROR demangling(<c[464da6a86cb672f]::Str<"'">>)
//~| ERROR demangling-alt(<c::Str<"'">>)
impl Str<"'"> {}

#[rustc_symbol_name]
//~^ ERROR symbol-name(_RMs0_Csno73SFvQKx_1cINtB3_3StrKRe090a_E)
//~| ERROR demangling(<c[464da6a86cb672f]::Str<"\t\n">>)
//~| ERROR demangling-alt(<c::Str<"\t\n">>)
impl Str<"\t\n"> {}

#[rustc_symbol_name]
//~^ ERROR symbol-name(_RMs1_Csno73SFvQKx_1cINtB3_3StrKRee28882c3bc_E)
//~| ERROR demangling(<c[464da6a86cb672f]::Str<"∂ü">>)
//~| ERROR demangling-alt(<c::Str<"∂ü">>)
impl Str<"∂ü"> {}

#[rustc_symbol_name]
//~^ ERROR symbol-name(_RMs2_Csno73SFvQKx_1cINtB3_3StrKRee183a1e18390e183ade1839be18394e1839ae18390e183935fe18392e18394e1839be183a0e18398e18394e1839ae183985fe183a1e18390e18393e18398e1839ae18398_E)
//~| ERROR demangling(<c[464da6a86cb672f]::Str<"საჭმელად_გემრიელი_სადილი">>)
//~| ERROR demangling-alt(<c::Str<"საჭმელად_გემრიელი_სადილი">>)
impl Str<"საჭმელად_გემრიელი_სადილი"> {}

#[rustc_symbol_name]
//~^ ERROR symbol-name(_RMs3_Csno73SFvQKx_1cINtB3_3StrKRef09f908af09fa688f09fa686f09f90ae20c2a720f09f90b6f09f9192e29895f09f94a520c2a720f09fa7a1f09f929bf09f929af09f9299f09f929c_E)
//~| ERROR demangling(<c[464da6a86cb672f]::Str<"🐊🦈🦆🐮 § 🐶👒☕🔥 § 🧡💛💚💙💜">>)
//~| ERROR demangling-alt(<c::Str<"🐊🦈🦆🐮 § 🐶👒☕🔥 § 🧡💛💚💙💜">>)
impl Str<"🐊🦈🦆🐮 § 🐶👒☕🔥 § 🧡💛💚💙💜"> {}

fn main() {}
110 changes: 110 additions & 0 deletions src/test/ui/symbol-names/const-generics-str-demangling.stderr
Original file line number Diff line number Diff line change
@@ -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(<c[464da6a86cb672f]::Str<"abc">>)
--> $DIR/const-generics-str-demangling.rs:8:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^

error: demangling-alt(<c::Str<"abc">>)
--> $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(<c[464da6a86cb672f]::Str<"'">>)
--> $DIR/const-generics-str-demangling.rs:14:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^

error: demangling-alt(<c::Str<"'">>)
--> $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(<c[464da6a86cb672f]::Str<"\t\n">>)
--> $DIR/const-generics-str-demangling.rs:20:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^

error: demangling-alt(<c::Str<"\t\n">>)
--> $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(<c[464da6a86cb672f]::Str<"∂ü">>)
--> $DIR/const-generics-str-demangling.rs:26:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^

error: demangling-alt(<c::Str<"∂ü">>)
--> $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(<c[464da6a86cb672f]::Str<"საჭმელად_გემრიელი_სადილი">>)
--> $DIR/const-generics-str-demangling.rs:32:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^

error: demangling-alt(<c::Str<"საჭმელად_გემრიელი_სადილი">>)
--> $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(<c[464da6a86cb672f]::Str<"🐊🦈🦆🐮 § 🐶👒☕🔥 § 🧡💛💚💙💜">>)
--> $DIR/const-generics-str-demangling.rs:38:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^

error: demangling-alt(<c::Str<"🐊🦈🦆🐮 § 🐶👒☕🔥 § 🧡💛💚💙💜">>)
--> $DIR/const-generics-str-demangling.rs:38:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^

error: aborting due to 18 previous errors

0 comments on commit af002c1

Please sign in to comment.