@@ -16,7 +16,7 @@ use rustc_middle::mir;
16
16
use rustc_middle:: mir:: interpret:: { AllocId , ConstValue , Pointer , Scalar } ;
17
17
use rustc_middle:: mir:: AssertKind ;
18
18
use 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 } ;
20
20
use rustc_span:: source_map:: Span ;
21
21
use rustc_span:: { sym, Symbol } ;
22
22
use rustc_target:: abi:: call:: { ArgAbi , FnAbi , PassMode } ;
@@ -423,7 +423,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
423
423
( lang_items:: PanicBoundsCheckFnLangItem , vec ! [ index, len, location] )
424
424
}
425
425
_ => {
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) ;
427
428
// It's `pub fn panic(expr: &str)`, with the wide reference being passed
428
429
// as two arguments, and `#[track_caller]` adds an implicit third argument.
429
430
( lang_items:: PanicFnLangItem , vec ! [ msg. 0 , msg. 1 , location] )
@@ -486,7 +487,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
486
487
} else {
487
488
format ! ( "attempted to leave type `{}` uninitialized, which is invalid" , ty)
488
489
} ;
489
- let msg = bx. const_str ( SymbolName :: new ( bx . tcx ( ) , & msg_str) ) ;
490
+ let msg = bx. const_str ( Symbol :: intern ( & msg_str) ) ;
490
491
let location = self . get_caller_location ( bx, span) . immediate ( ) ;
491
492
492
493
// Obtain the panic entry point.
0 commit comments