@@ -16,7 +16,7 @@ use rustc_middle::mir;
1616use rustc_middle:: mir:: interpret:: { AllocId , ConstValue , Pointer , Scalar } ;
1717use rustc_middle:: mir:: AssertKind ;
1818use rustc_middle:: ty:: layout:: { FnAbiExt , HasTyCtxt } ;
19- use rustc_middle:: ty:: { self , Instance , SymbolName , Ty , TypeFoldable } ;
19+ use rustc_middle:: ty:: { self , Instance , Ty , TypeFoldable } ;
2020use rustc_span:: source_map:: Span ;
2121use rustc_span:: { sym, Symbol } ;
2222use rustc_target:: abi:: call:: { ArgAbi , FnAbi , PassMode } ;
@@ -423,7 +423,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
423423 ( lang_items:: PanicBoundsCheckFnLangItem , vec ! [ index, len, location] )
424424 }
425425 _ => {
426- let msg = bx. const_str ( SymbolName :: new ( bx. tcx ( ) , msg. description ( ) ) ) ;
426+ let msg_str = Symbol :: intern ( msg. description ( ) ) ;
427+ let msg = bx. const_str ( msg_str) ;
427428 // It's `pub fn panic(expr: &str)`, with the wide reference being passed
428429 // as two arguments, and `#[track_caller]` adds an implicit third argument.
429430 ( lang_items:: PanicFnLangItem , vec ! [ msg. 0 , msg. 1 , location] )
@@ -486,7 +487,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
486487 } else {
487488 format ! ( "attempted to leave type `{}` uninitialized, which is invalid" , ty)
488489 } ;
489- let msg = bx. const_str ( SymbolName :: new ( bx . tcx ( ) , & msg_str) ) ;
490+ let msg = bx. const_str ( Symbol :: intern ( & msg_str) ) ;
490491 let location = self . get_caller_location ( bx, span) . immediate ( ) ;
491492
492493 // Obtain the panic entry point.
0 commit comments