@@ -193,13 +193,12 @@ fn compute_symbol_name<'tcx>(
193
193
// defining crate.
194
194
// Weak lang items automatically get #[rustc_std_internal_symbol]
195
195
// applied by the code computing the CodegenFnAttrs.
196
- // We are mangling all #[rustc_std_internal_symbol] items that don't
197
- // also have #[no_mangle] as a combination of the rustc version and the
198
- // unmangled linkage name. This is to ensure that if we link against a
199
- // staticlib compiled by a different rustc version, we don't get symbol
200
- // conflicts or even UB due to a different implementation/ABI. Rust
201
- // staticlibs currently export all symbols, including those that are
202
- // hidden in cdylibs.
196
+ // We are mangling all #[rustc_std_internal_symbol] items as a
197
+ // combination of the rustc version and the unmangled linkage name.
198
+ // This is to ensure that if we link against a staticlib compiled by a
199
+ // different rustc version, we don't get symbol conflicts or even UB
200
+ // due to a different implementation/ABI. Rust staticlibs currently
201
+ // export all symbols, including those that are hidden in cdylibs.
203
202
// We are using the v0 symbol mangling scheme here as we need to be
204
203
// consistent across all crates and in some contexts the legacy symbol
205
204
// mangling scheme can't be used. For example both the GCC backend and
@@ -211,11 +210,7 @@ fn compute_symbol_name<'tcx>(
211
210
if let Some ( name) = attrs. export_name { name } else { tcx. item_name ( def_id) }
212
211
} ;
213
212
214
- if attrs. flags . contains ( CodegenFnAttrFlags :: NO_MANGLE ) {
215
- return name. to_string ( ) ;
216
- } else {
217
213
return v0:: mangle_internal_symbol ( tcx, name. as_str ( ) ) ;
218
- }
219
214
}
220
215
221
216
let wasm_import_module_exception_force_mangling = {
0 commit comments