Skip to content

Commit 4cf8b15

Browse files
committed
Auto merge of #144678 - jdonszelmann:no-mangle-extern, r=bjorn3
Make no_mangle on foreign items explicit instead of implicit for a followup PR I'm working on I need some foreign items to mangle. I could add a new attribute: `no_no_mangle` or something silly like that but by explicitly putting `no_mangle` in the codegen fn attrs of foreign items we can default it to `no_mangle` and then easily remove it when we don't want it. I guess you'd know about this r? `@bjorn3.` Shouldn't be too hard to review :) Builds on rust-lang/rust#144655 which should merge first.
2 parents f393c32 + b70d9c0 commit 4cf8b15

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/bin/miri.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls {
279279
return None;
280280
}
281281
let codegen_fn_attrs = tcx.codegen_fn_attrs(local_def_id);
282-
if codegen_fn_attrs.contains_extern_indicator()
282+
if codegen_fn_attrs.contains_extern_indicator(tcx, local_def_id.into())
283283
|| codegen_fn_attrs
284284
.flags
285285
.contains(CodegenFnAttrFlags::USED_COMPILER)

src/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub fn iter_exported_symbols<'tcx>(
132132
for def_id in crate_items.definitions() {
133133
let exported = tcx.def_kind(def_id).has_codegen_attrs() && {
134134
let codegen_attrs = tcx.codegen_fn_attrs(def_id);
135-
codegen_attrs.contains_extern_indicator()
135+
codegen_attrs.contains_extern_indicator(tcx, def_id.into())
136136
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL)
137137
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED_COMPILER)
138138
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER)

0 commit comments

Comments
 (0)