File tree Expand file tree Collapse file tree
crates/rustc_codegen_spirv/src/codegen_cx Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ use rustc_middle::ty::layout::{FnAbiOf, LayoutOf};
1919use rustc_middle:: ty:: { self , Instance , TypeVisitableExt , TypingEnv } ;
2020use rustc_span:: Span ;
2121use rustc_span:: def_id:: DefId ;
22+ use rustc_span:: symbol:: sym;
2223
2324fn attrs_to_spirv ( attrs : & CodegenFnAttrs ) -> FunctionControl {
2425 let mut control = FunctionControl :: NONE ;
@@ -227,10 +228,11 @@ impl<'tcx> CodegenCx<'tcx> {
227228 {
228229 self . panic_entry_points . borrow_mut ( ) . insert ( def_id) ;
229230 }
230- if demangled_symbol_name. ends_with ( "::precondition_check" ) {
231+ let is_nonlocal_core = !def_id. is_local ( ) && self . tcx . crate_name ( def_id. krate ) == sym:: core;
232+ if is_nonlocal_core && demangled_symbol_name. ends_with ( "::precondition_check" ) {
231233 self . panic_entry_points . borrow_mut ( ) . insert ( def_id) ;
232234 }
233- if demangled_symbol_name. contains ( "::bounds_check" ) {
235+ if is_nonlocal_core && demangled_symbol_name. ends_with ( "::bounds_check" ) {
234236 self . panic_entry_points . borrow_mut ( ) . insert ( def_id) ;
235237 }
236238 if let Some ( pieces_len) = demangled_symbol_name
You can’t perform that action at this time.
0 commit comments