|
| 1 | +use rustc_abi::ExternAbi; |
1 | 2 | use rustc_ast::InlineAsmOptions; |
2 | 3 | use rustc_middle::mir::*; |
3 | 4 | use rustc_middle::span_bug; |
4 | 5 | use rustc_middle::ty::{self, TyCtxt, layout}; |
5 | 6 | use rustc_target::spec::PanicStrategy; |
6 | | -use rustc_target::spec::abi::Abi; |
7 | 7 |
|
8 | 8 | /// A pass that runs which is targeted at ensuring that codegen guarantees about |
9 | 9 | /// unwinding are upheld for compilations of panic=abort programs. |
@@ -38,9 +38,9 @@ impl<'tcx> crate::MirPass<'tcx> for AbortUnwindingCalls { |
38 | 38 | let body_ty = tcx.type_of(def_id).skip_binder(); |
39 | 39 | let body_abi = match body_ty.kind() { |
40 | 40 | ty::FnDef(..) => body_ty.fn_sig(tcx).abi(), |
41 | | - ty::Closure(..) => Abi::RustCall, |
42 | | - ty::CoroutineClosure(..) => Abi::RustCall, |
43 | | - ty::Coroutine(..) => Abi::Rust, |
| 41 | + ty::Closure(..) => ExternAbi::RustCall, |
| 42 | + ty::CoroutineClosure(..) => ExternAbi::RustCall, |
| 43 | + ty::Coroutine(..) => ExternAbi::Rust, |
44 | 44 | ty::Error(_) => return, |
45 | 45 | _ => span_bug!(body.span, "unexpected body ty: {:?}", body_ty), |
46 | 46 | }; |
@@ -79,10 +79,10 @@ impl<'tcx> crate::MirPass<'tcx> for AbortUnwindingCalls { |
79 | 79 | } |
80 | 80 | TerminatorKind::Drop { .. } => { |
81 | 81 | tcx.sess.opts.unstable_opts.panic_in_drop == PanicStrategy::Unwind |
82 | | - && layout::fn_can_unwind(tcx, None, Abi::Rust) |
| 82 | + && layout::fn_can_unwind(tcx, None, ExternAbi::Rust) |
83 | 83 | } |
84 | 84 | TerminatorKind::Assert { .. } | TerminatorKind::FalseUnwind { .. } => { |
85 | | - layout::fn_can_unwind(tcx, None, Abi::Rust) |
| 85 | + layout::fn_can_unwind(tcx, None, ExternAbi::Rust) |
86 | 86 | } |
87 | 87 | TerminatorKind::InlineAsm { options, .. } => { |
88 | 88 | options.contains(InlineAsmOptions::MAY_UNWIND) |
|
0 commit comments