Skip to content

Commit 4f38294

Browse files
committed
support panic_nounwind
1 parent 1c4524b commit 4f38294

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
13901390
lhs,
13911391
)
13921392
};
1393-
1393+
13941394
(result, overflowed)
13951395
}
13961396

@@ -2818,8 +2818,9 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
28182818
kind: SpirvValueKind::Def(b_id),
28192819
..
28202820
},
2821-
_, // `&'static panic::Location<'static>`
2822-
] = args[..]
2821+
// NOTE(fee1-dead): the standard `panic` takes in a `Location` due to `track_caller`.
2822+
// but for `panic_nounwind` it does not, therefore we only look at the first two arguments.
2823+
] = args[..2]
28232824
{
28242825
if let Some(const_msg) = const_str_as_utf8(&[a_id, b_id]) {
28252826
decoded_format_args.const_pieces = Some([const_msg].into_iter().collect());

crates/rustc_codegen_spirv/src/codegen_cx/declare.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ impl<'tcx> CodegenCx<'tcx> {
181181
if [
182182
self.tcx.lang_items().panic_fn(),
183183
self.tcx.lang_items().panic_fmt(),
184+
self.tcx.lang_items().panic_nounwind(),
184185
]
185186
.contains(&Some(def_id))
186187
{

0 commit comments

Comments
 (0)