File tree 2 files changed +10
-14
lines changed
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(
271
271
false
272
272
} else if let Some ( id) = id {
273
273
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 ) {
279
275
// Since we are adding a shim to abort on panic, this cannot unwind.
280
276
false
281
277
} else {
Original file line number Diff line number Diff line change 4
4
#![ feature( unwind_attributes) ]
5
5
6
6
extern {
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 ( ) ;
10
10
// CHECK-NOT: nounwind
11
11
// CHECK: declare void @unwinding_extern_fn
12
12
#[ unwind( allowed) ]
13
13
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
16
16
#[ unwind( aborts) ]
17
- fn aborting_extern_fn ( ) ; // FIXME: we don't have the attribute here
17
+ fn aborting_extern_fn ( ) ;
18
18
}
19
19
20
20
extern "Rust" {
@@ -25,10 +25,10 @@ extern "Rust" {
25
25
// CHECK: declare void @rust_unwinding_extern_fn
26
26
#[ unwind( allowed) ]
27
27
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
30
30
#[ unwind( aborts) ]
31
- fn rust_aborting_extern_fn ( ) ; // FIXME: we don't have the attribute here
31
+ fn rust_aborting_extern_fn ( ) ;
32
32
}
33
33
34
34
pub unsafe fn force_declare ( ) {
You can’t perform that action at this time.
0 commit comments