From e71f4665f6cf2e200a40eaed12bcaa603dfbc08f Mon Sep 17 00:00:00 2001 From: David Wood Date: Sat, 1 Jun 2019 11:37:11 +0100 Subject: [PATCH] codegen: change `$6d$` to `$u6d$` This changes a mistake introduced in #61195 where the mangling workaround used was incorrect. --- src/librustc_codegen_utils/symbol_names/legacy.rs | 2 +- src/test/ui/symbol-names/issue-60925.legacy.stderr | 6 +++--- src/test/ui/symbol-names/issue-60925.rs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/librustc_codegen_utils/symbol_names/legacy.rs b/src/librustc_codegen_utils/symbol_names/legacy.rs index 53682b9bdc2c8..6eaa22afce19a 100644 --- a/src/librustc_codegen_utils/symbol_names/legacy.rs +++ b/src/librustc_codegen_utils/symbol_names/legacy.rs @@ -440,7 +440,7 @@ impl fmt::Write for SymbolPrinter<'_, '_> { '-' | ':' => self.path.temp_buf.push('.'), // Avoid crashing LLVM in certain (LTO-related) situations, see #60925. - 'm' if self.path.temp_buf.ends_with(".llv") => self.path.temp_buf.push_str("$6d$"), + 'm' if self.path.temp_buf.ends_with(".llv") => self.path.temp_buf.push_str("$u6d$"), // These are legal symbols 'a'..='z' | 'A'..='Z' | '0'..='9' | '_' | '.' | '$' => self.path.temp_buf.push(c), diff --git a/src/test/ui/symbol-names/issue-60925.legacy.stderr b/src/test/ui/symbol-names/issue-60925.legacy.stderr index 0bbe424aa025b..7fcd2ede31b69 100644 --- a/src/test/ui/symbol-names/issue-60925.legacy.stderr +++ b/src/test/ui/symbol-names/issue-60925.legacy.stderr @@ -1,16 +1,16 @@ -error: symbol-name(_ZN11issue_609253foo36Foo$LT$issue_60925..llv$6d$..Foo$GT$3foo17h059a991a004536adE) +error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17h059a991a004536adE) --> $DIR/issue-60925.rs:21:9 | LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling(issue_60925::foo::Foo $DIR/issue-60925.rs:21:9 | LL | #[rustc_symbol_name] | ^^^^^^^^^^^^^^^^^^^^ -error: demangling-alt(issue_60925::foo::Foo $DIR/issue-60925.rs:21:9 | LL | #[rustc_symbol_name] diff --git a/src/test/ui/symbol-names/issue-60925.rs b/src/test/ui/symbol-names/issue-60925.rs index 09d68eebb950e..89de15cc0f3e4 100644 --- a/src/test/ui/symbol-names/issue-60925.rs +++ b/src/test/ui/symbol-names/issue-60925.rs @@ -19,9 +19,9 @@ mod foo { impl Foo<::llvm::Foo> { #[rustc_symbol_name] - //[legacy]~^ ERROR symbol-name(_ZN11issue_609253foo36Foo$LT$issue_60925..llv$6d$..Foo$GT$3foo - //[legacy]~| ERROR demangling(issue_60925::foo::Foo>::foo) //[v0]~| ERROR demangling-alt(>::foo)