@@ -6,15 +6,14 @@ use rustc::hir::{CodegenFnAttrFlags, CodegenFnAttrs};
6
6
use rustc:: hir:: def_id:: { DefId , LOCAL_CRATE } ;
7
7
use rustc:: session:: Session ;
8
8
use rustc:: session:: config:: { Sanitizer , OptLevel } ;
9
- use rustc:: ty:: { self , TyCtxt , PolyFnSig } ;
9
+ use rustc:: ty:: { TyCtxt , PolyFnSig } ;
10
10
use rustc:: ty:: layout:: HasTyCtxt ;
11
11
use rustc:: ty:: query:: Providers ;
12
12
use rustc_data_structures:: small_c_str:: SmallCStr ;
13
13
use rustc_data_structures:: fx:: FxHashMap ;
14
14
use rustc_target:: spec:: PanicStrategy ;
15
15
use rustc_codegen_ssa:: traits:: * ;
16
16
17
- use crate :: abi:: Abi ;
18
17
use crate :: attributes;
19
18
use crate :: llvm:: { self , Attribute } ;
20
19
use crate :: llvm:: AttributePlace :: Function ;
@@ -201,7 +200,7 @@ pub fn from_fn_attrs(
201
200
cx : & CodegenCx < ' ll , ' tcx > ,
202
201
llfn : & ' ll Value ,
203
202
id : Option < DefId > ,
204
- sig : PolyFnSig < ' tcx > ,
203
+ _sig : PolyFnSig < ' tcx > ,
205
204
) {
206
205
let codegen_fn_attrs = id. map ( |id| cx. tcx . codegen_fn_attrs ( id) )
207
206
. unwrap_or_else ( || CodegenFnAttrs :: new ( ) ) ;
@@ -274,17 +273,6 @@ pub fn from_fn_attrs(
274
273
} else if codegen_fn_attrs. flags . contains ( CodegenFnAttrFlags :: RUSTC_ALLOCATOR_NOUNWIND ) {
275
274
// Special attribute for allocator functions, which can't unwind
276
275
false
277
- } else if let Some ( id) = id {
278
- let sig = cx. tcx . normalize_erasing_late_bound_regions ( ty:: ParamEnv :: reveal_all ( ) , & sig) ;
279
- if cx. tcx . is_foreign_item ( id) && sig. abi != Abi :: Rust && sig. abi != Abi :: RustCall {
280
- // Foreign non-Rust items like `extern "C" { fn foo(); }` are assumed not to
281
- // unwind
282
- false
283
- } else {
284
- // Anything else defined in Rust is assumed that it can possibly
285
- // unwind
286
- true
287
- }
288
276
} else {
289
277
// assume this can possibly unwind, avoiding the application of a
290
278
// `nounwind` attribute below.
0 commit comments