@@ -95,7 +95,7 @@ use rustc::ty::query::Providers;
95
95
use rustc:: ty:: { self , TyCtxt , Instance } ;
96
96
use rustc:: mir:: mono:: { MonoItem , InstantiationMode } ;
97
97
98
- use syntax_pos:: symbol:: InternedString ;
98
+ use syntax_pos:: symbol:: Symbol ;
99
99
100
100
use log:: debug;
101
101
@@ -112,7 +112,7 @@ pub fn provide(providers: &mut Providers<'_>) {
112
112
} ;
113
113
}
114
114
115
- fn symbol_name ( tcx : TyCtxt < ' tcx > , instance : Instance < ' tcx > ) -> InternedString {
115
+ fn symbol_name ( tcx : TyCtxt < ' tcx > , instance : Instance < ' tcx > ) -> Symbol {
116
116
let def_id = instance. def_id ( ) ;
117
117
let substs = instance. substs ;
118
118
@@ -123,13 +123,11 @@ fn symbol_name(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> InternedString {
123
123
if def_id. is_local ( ) {
124
124
if tcx. plugin_registrar_fn ( LOCAL_CRATE ) == Some ( def_id) {
125
125
let disambiguator = tcx. sess . local_crate_disambiguator ( ) ;
126
- return
127
- InternedString :: intern ( & tcx. sess . generate_plugin_registrar_symbol ( disambiguator) ) ;
126
+ return Symbol :: intern ( & tcx. sess . generate_plugin_registrar_symbol ( disambiguator) ) ;
128
127
}
129
128
if tcx. proc_macro_decls_static ( LOCAL_CRATE ) == Some ( def_id) {
130
129
let disambiguator = tcx. sess . local_crate_disambiguator ( ) ;
131
- return
132
- InternedString :: intern ( & tcx. sess . generate_proc_macro_decls_symbol ( disambiguator) ) ;
130
+ return Symbol :: intern ( & tcx. sess . generate_proc_macro_decls_symbol ( disambiguator) ) ;
133
131
}
134
132
}
135
133
@@ -146,23 +144,22 @@ fn symbol_name(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> InternedString {
146
144
let attrs = tcx. codegen_fn_attrs ( def_id) ;
147
145
if is_foreign {
148
146
if let Some ( name) = attrs. link_name {
149
- return name. as_interned_str ( ) ;
147
+ return name;
150
148
}
151
149
// Don't mangle foreign items.
152
- return tcx. item_name ( def_id) . as_interned_str ( ) ;
150
+ return tcx. item_name ( def_id) ;
153
151
}
154
152
155
- if let Some ( name) = & attrs. export_name {
153
+ if let Some ( name) = attrs. export_name {
156
154
// Use provided name
157
- return name. as_interned_str ( ) ;
155
+ return name;
158
156
}
159
157
160
158
if attrs. flags . contains ( CodegenFnAttrFlags :: NO_MANGLE ) {
161
159
// Don't mangle
162
- return tcx. item_name ( def_id) . as_interned_str ( ) ;
160
+ return tcx. item_name ( def_id) ;
163
161
}
164
162
165
-
166
163
let is_generic = substs. non_erasable_generics ( ) . next ( ) . is_some ( ) ;
167
164
let avoid_cross_crate_conflicts =
168
165
// If this is an instance of a generic function, we also hash in
@@ -222,5 +219,5 @@ fn symbol_name(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> InternedString {
222
219
SymbolManglingVersion :: V0 => v0:: mangle ( tcx, instance, instantiating_crate) ,
223
220
} ;
224
221
225
- InternedString :: intern ( & mangled)
222
+ Symbol :: intern ( & mangled)
226
223
}
0 commit comments