@@ -6,15 +6,14 @@ use rustc::hir::{CodegenFnAttrFlags, CodegenFnAttrs};
66use rustc:: hir:: def_id:: { DefId , LOCAL_CRATE } ;
77use rustc:: session:: Session ;
88use rustc:: session:: config:: { Sanitizer , OptLevel } ;
9- use rustc:: ty:: { self , TyCtxt , PolyFnSig } ;
9+ use rustc:: ty:: { TyCtxt , PolyFnSig } ;
1010use rustc:: ty:: layout:: HasTyCtxt ;
1111use rustc:: ty:: query:: Providers ;
1212use rustc_data_structures:: small_c_str:: SmallCStr ;
1313use rustc_data_structures:: fx:: FxHashMap ;
1414use rustc_target:: spec:: PanicStrategy ;
1515use rustc_codegen_ssa:: traits:: * ;
1616
17- use crate :: abi:: Abi ;
1817use crate :: attributes;
1918use crate :: llvm:: { self , Attribute } ;
2019use crate :: llvm:: AttributePlace :: Function ;
@@ -201,7 +200,7 @@ pub fn from_fn_attrs(
201200 cx : & CodegenCx < ' ll , ' tcx > ,
202201 llfn : & ' ll Value ,
203202 id : Option < DefId > ,
204- sig : PolyFnSig < ' tcx > ,
203+ _sig : PolyFnSig < ' tcx > ,
205204) {
206205 let codegen_fn_attrs = id. map ( |id| cx. tcx . codegen_fn_attrs ( id) )
207206 . unwrap_or_else ( || CodegenFnAttrs :: new ( ) ) ;
@@ -274,17 +273,6 @@ pub fn from_fn_attrs(
274273 } else if codegen_fn_attrs. flags . contains ( CodegenFnAttrFlags :: RUSTC_ALLOCATOR_NOUNWIND ) {
275274 // Special attribute for allocator functions, which can't unwind
276275 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- }
288276 } else {
289277 // assume this can possibly unwind, avoiding the application of a
290278 // `nounwind` attribute below.
0 commit comments