@@ -502,24 +502,21 @@ macro_rules! unpack {
502
502
} ;
503
503
}
504
504
505
- fn should_abort_on_panic ( tcx : TyCtxt < ' _ > , fn_def_id : DefId , abi : Abi ) -> bool {
506
- // Not callable from C, so we can safely unwind through these
507
- if abi == Abi :: Rust || abi == Abi :: RustCall { return false ; }
508
-
509
- // Validate `#[unwind]` syntax regardless of platform-specific panic strategy
505
+ fn should_abort_on_panic ( tcx : TyCtxt < ' _ > , fn_def_id : DefId , _abi : Abi ) -> bool {
506
+ // Validate `#[unwind]` syntax regardless of platform-specific panic strategy.
510
507
let attrs = & tcx. get_attrs ( fn_def_id) ;
511
508
let unwind_attr = attr:: find_unwind_attr ( Some ( tcx. sess . diagnostic ( ) ) , attrs) ;
512
509
513
- // We never unwind, so it's not relevant to stop an unwind
510
+ // We never unwind, so it's not relevant to stop an unwind.
514
511
if tcx. sess . panic_strategy ( ) != PanicStrategy :: Unwind { return false ; }
515
512
516
- // We cannot add landing pads, so don't add one
513
+ // We cannot add landing pads, so don't add one.
517
514
if tcx. sess . no_landing_pads ( ) { return false ; }
518
515
519
516
// This is a special case: some functions have a C abi but are meant to
520
517
// unwind anyway. Don't stop them.
521
518
match unwind_attr {
522
- None => false , // FIXME(#58794)
519
+ None => false , // FIXME(#58794); should be `!(abi == Abi::Rust || abi == Abi::RustCall)`
523
520
Some ( UnwindAttr :: Allowed ) => false ,
524
521
Some ( UnwindAttr :: Aborts ) => true ,
525
522
}
0 commit comments