From 37c00c41f82e50c3b3ca43326faa6ccb909fb2b5 Mon Sep 17 00:00:00 2001 From: varkor Date: Wed, 7 Oct 2020 19:31:23 +0100 Subject: [PATCH] Do not print type for placeholder values --- compiler/rustc_symbol_mangling/src/v0.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_symbol_mangling/src/v0.rs b/compiler/rustc_symbol_mangling/src/v0.rs index 8c6ed7bd1407..7833385cbc99 100644 --- a/compiler/rustc_symbol_mangling/src/v0.rs +++ b/compiler/rustc_symbol_mangling/src/v0.rs @@ -548,9 +548,10 @@ impl Printer<'tcx> for SymbolMangler<'tcx> { bug!("symbol_names: unsupported constant of type `{}` ({:?})", ct.ty, ct); } }; - self = ct.ty.print(self)?; if let Some(bits) = val { + // We only print the type if the const can be evaluated. + self = ct.ty.print(self)?; let _ = write!(self.out, "{}{:x}_", if neg { "n" } else { "" }, bits); } else { // NOTE(eddyb) despite having the path, we need to