Skip to content

Commit a7e4794

Browse files
committed
Fix handling of rust_eh_personality in reachable_non_generics
1 parent d8c8148 commit a7e4794

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,14 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, cnum: CrateNum) -> DefIdMap<
103103
}
104104
})
105105
.map(|def_id| {
106-
let (export_level, used) = if special_runtime_crate {
107-
let name = tcx.symbol_name(Instance::mono(tcx, def_id.to_def_id())).name;
108-
// We won't link right if these symbols are stripped during LTO.
109-
let used = match name {
110-
"rust_eh_personality"
111-
| "rust_eh_register_frames"
112-
| "rust_eh_unregister_frames" => true,
113-
_ => false,
114-
};
115-
(SymbolExportLevel::Rust, used)
106+
// We won't link right if this symbol is stripped during LTO.
107+
let name = tcx.symbol_name(Instance::mono(tcx, def_id.to_def_id())).name;
108+
let used = name == "rust_eh_personality";
109+
110+
let export_level = if special_runtime_crate {
111+
SymbolExportLevel::Rust
116112
} else {
117-
(symbol_export_level(tcx, def_id.to_def_id()), false)
113+
symbol_export_level(tcx, def_id.to_def_id())
118114
};
119115
let codegen_attrs = tcx.codegen_fn_attrs(def_id.to_def_id());
120116
debug!(

0 commit comments

Comments
 (0)