Skip to content

Commit e1591d0

Browse files
committed
Fix panic-entry matching and disable-pqp unused-features lint
1 parent cb223c7 commit e1591d0

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

crates/rustc_codegen_spirv/src/codegen_cx/declare.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,16 @@ impl<'tcx> CodegenCx<'tcx> {
228228
{
229229
self.panic_entry_points.borrow_mut().insert(def_id);
230230
}
231-
let is_nonlocal_core = !def_id.is_local() && self.tcx.crate_name(def_id.krate) == sym::core;
231+
let is_nonlocal = !def_id.is_local();
232+
let is_nonlocal_core = is_nonlocal && self.tcx.crate_name(def_id.krate) == sym::core;
232233
if is_nonlocal_core && demangled_symbol_name.ends_with("::precondition_check") {
233234
self.panic_entry_points.borrow_mut().insert(def_id);
234235
}
235-
if is_nonlocal_core && demangled_symbol_name.ends_with("::bounds_check") {
236+
let is_spirv_std_byte_addressable_bounds_check =
237+
is_nonlocal && self.tcx.def_path_str(def_id) == "spirv_std::byte_addressable_buffer::bounds_check";
238+
if (is_nonlocal_core && demangled_symbol_name.ends_with("::bounds_check"))
239+
|| is_spirv_std_byte_addressable_bounds_check
240+
{
236241
self.panic_entry_points.borrow_mut().insert(def_id);
237242
}
238243
if let Some(pieces_len) = demangled_symbol_name

crates/rustc_codegen_spirv/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#![feature(string_from_utf8_lossy_owned)]
1010
#![feature(trait_alias)]
1111
#![feature(try_blocks)]
12+
#![cfg_attr(rustc_codegen_spirv_disable_pqp_cg_ssa, allow(unused_features))]
1213
#![recursion_limit = "256"]
1314
// HACK(eddyb) end of `rustc_codegen_ssa` crate-level attributes (see `build.rs`).
1415

0 commit comments

Comments
 (0)