@@ -16,7 +16,7 @@ use rustc::ty::{
16
16
Ty ,
17
17
} ;
18
18
use rustc_ast:: attr;
19
- use rustc_span:: { source_map:: Span , symbol:: sym} ;
19
+ use rustc_span:: { source_map:: Span , symbol:: { sym, Symbol } } ;
20
20
21
21
use crate :: * ;
22
22
@@ -75,7 +75,7 @@ pub struct MemoryExtra {
75
75
pub intptrcast : intptrcast:: MemoryExtra ,
76
76
77
77
/// Mapping extern static names to their canonical allocation.
78
- pub ( crate ) extern_statics : HashMap < & ' static str , AllocId > ,
78
+ pub ( crate ) extern_statics : HashMap < Symbol , AllocId > ,
79
79
80
80
/// The random number generator used for resolving non-determinism.
81
81
/// Needs to be queried by ptr_to_int, hence needs interior mutability.
@@ -111,7 +111,7 @@ impl MemoryExtra {
111
111
this. memory
112
112
. extra
113
113
. extern_statics
114
- . insert ( "__cxa_thread_atexit_impl" , place. ptr . assert_ptr ( ) . alloc_id )
114
+ . insert ( Symbol :: intern ( "__cxa_thread_atexit_impl" ) , place. ptr . assert_ptr ( ) . alloc_id )
115
115
. unwrap_none ( ) ;
116
116
}
117
117
_ => { } // No "extern statics" supported on this platform
@@ -310,11 +310,11 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
310
310
} ;
311
311
let attrs = tcx. get_attrs ( def_id) ;
312
312
let link_name = match attr:: first_attr_value_str_by_name ( & attrs, sym:: link_name) {
313
- Some ( name) => name. as_str ( ) ,
314
- None => tcx. item_name ( def_id) . as_str ( ) ,
313
+ Some ( name) => name,
314
+ None => tcx. item_name ( def_id) ,
315
315
} ;
316
316
// Check if we know this one.
317
- if let Some ( canonical_id) = mem. extra . extern_statics . get ( & * link_name) {
317
+ if let Some ( canonical_id) = mem. extra . extern_statics . get ( & link_name) {
318
318
trace ! ( "canonical_alloc_id: {:?} ({}) -> {:?}" , id, link_name, canonical_id) ;
319
319
* canonical_id
320
320
} else {
0 commit comments