File tree Expand file tree Collapse file tree 2 files changed +10
-14
lines changed Expand file tree Collapse file tree 2 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -271,11 +271,7 @@ pub fn from_fn_attrs(
271271 false
272272 } else if let Some ( id) = id {
273273 let sig = cx. tcx . normalize_erasing_late_bound_regions ( ty:: ParamEnv :: reveal_all ( ) , & sig) ;
274- if cx. tcx . is_foreign_item ( id) {
275- // Foreign items like `extern "C" { fn foo(); }` and `extern "Rust" { fn bar(); }`
276- // are assumed not to unwind.
277- false
278- } else if cx. tcx . abort_on_panic_shim ( id, sig. abi ) {
274+ if cx. tcx . abort_on_panic_shim ( id, sig. abi ) {
279275 // Since we are adding a shim to abort on panic, this cannot unwind.
280276 false
281277 } else {
Original file line number Diff line number Diff line change 44#![ feature( unwind_attributes) ]
55
66extern {
7- // CHECK: Function Attrs : nounwind
8- // CHECK-NEXT : declare void @extern_fn
9- fn extern_fn ( ) ; // assumed not to unwind
7+ // CHECK-NOT : nounwind
8+ // CHECK: declare void @extern_fn
9+ fn extern_fn ( ) ;
1010// CHECK-NOT: nounwind
1111// CHECK: declare void @unwinding_extern_fn
1212 #[ unwind( allowed) ]
1313 fn unwinding_extern_fn ( ) ;
14- // CHECK-NOT : nounwind
15- // CHECK: declare void @aborting_extern_fn
14+ // CHECK: Function Attrs : nounwind
15+ // CHECK-NEXT : declare void @aborting_extern_fn
1616 #[ unwind( aborts) ]
17- fn aborting_extern_fn ( ) ; // FIXME: we don't have the attribute here
17+ fn aborting_extern_fn ( ) ;
1818}
1919
2020extern "Rust" {
@@ -25,10 +25,10 @@ extern "Rust" {
2525// CHECK: declare void @rust_unwinding_extern_fn
2626 #[ unwind( allowed) ]
2727 fn rust_unwinding_extern_fn ( ) ;
28- // CHECK-NOT : nounwind
29- // CHECK: declare void @rust_aborting_extern_fn
28+ // CHECK: Function Attrs : nounwind
29+ // CHECK-NEXT : declare void @rust_aborting_extern_fn
3030 #[ unwind( aborts) ]
31- fn rust_aborting_extern_fn ( ) ; // FIXME: we don't have the attribute here
31+ fn rust_aborting_extern_fn ( ) ;
3232}
3333
3434pub unsafe fn force_declare ( ) {
You can’t perform that action at this time.
0 commit comments