1+ use rustc_abi:: ExternAbi ;
12use rustc_ast:: ptr:: P ;
23use rustc_ast:: visit:: AssocCtxt ;
34use rustc_ast:: * ;
@@ -11,7 +12,6 @@ use rustc_middle::span_bug;
1112use rustc_middle:: ty:: { ResolverAstLowering , TyCtxt } ;
1213use rustc_span:: edit_distance:: find_best_match_for_name;
1314use rustc_span:: { DesugaringKind , Ident , Span , Symbol , kw, sym} ;
14- use rustc_target:: spec:: abi;
1515use smallvec:: { SmallVec , smallvec} ;
1616use thin_vec:: ThinVec ;
1717use tracing:: instrument;
@@ -275,7 +275,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
275275 ModKind :: Unloaded => panic ! ( "`mod` items should have been loaded by now" ) ,
276276 } ,
277277 ItemKind :: ForeignMod ( fm) => hir:: ItemKind :: ForeignMod {
278- abi : fm. abi . map_or ( abi :: Abi :: FALLBACK , |abi| self . lower_abi ( abi) ) ,
278+ abi : fm. abi . map_or ( ExternAbi :: FALLBACK , |abi| self . lower_abi ( abi) ) ,
279279 items : self
280280 . arena
281281 . alloc_from_iter ( fm. items . iter ( ) . map ( |x| self . lower_foreign_item_ref ( x) ) ) ,
@@ -1470,23 +1470,23 @@ impl<'hir> LoweringContext<'_, 'hir> {
14701470 }
14711471 }
14721472
1473- pub ( super ) fn lower_abi ( & mut self , abi : StrLit ) -> abi :: Abi {
1474- abi :: lookup ( abi. symbol_unescaped . as_str ( ) ) . unwrap_or_else ( |err| {
1473+ pub ( super ) fn lower_abi ( & mut self , abi : StrLit ) -> ExternAbi {
1474+ rustc_abi :: lookup ( abi. symbol_unescaped . as_str ( ) ) . unwrap_or_else ( |err| {
14751475 self . error_on_invalid_abi ( abi, err) ;
1476- abi :: Abi :: Rust
1476+ ExternAbi :: Rust
14771477 } )
14781478 }
14791479
1480- pub ( super ) fn lower_extern ( & mut self , ext : Extern ) -> abi :: Abi {
1480+ pub ( super ) fn lower_extern ( & mut self , ext : Extern ) -> ExternAbi {
14811481 match ext {
1482- Extern :: None => abi :: Abi :: Rust ,
1483- Extern :: Implicit ( _) => abi :: Abi :: FALLBACK ,
1482+ Extern :: None => ExternAbi :: Rust ,
1483+ Extern :: Implicit ( _) => ExternAbi :: FALLBACK ,
14841484 Extern :: Explicit ( abi, _) => self . lower_abi ( abi) ,
14851485 }
14861486 }
14871487
1488- fn error_on_invalid_abi ( & self , abi : StrLit , err : abi :: AbiUnsupported ) {
1489- let abi_names = abi :: enabled_names ( self . tcx . features ( ) , abi. span )
1488+ fn error_on_invalid_abi ( & self , abi : StrLit , err : rustc_abi :: AbiUnsupported ) {
1489+ let abi_names = rustc_abi :: enabled_names ( self . tcx . features ( ) , abi. span )
14901490 . iter ( )
14911491 . map ( |s| Symbol :: intern ( s) )
14921492 . collect :: < Vec < _ > > ( ) ;
@@ -1495,7 +1495,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
14951495 abi : abi. symbol_unescaped ,
14961496 span : abi. span ,
14971497 explain : match err {
1498- abi :: AbiUnsupported :: Reason { explain } => Some ( InvalidAbiReason ( explain) ) ,
1498+ rustc_abi :: AbiUnsupported :: Reason { explain } => Some ( InvalidAbiReason ( explain) ) ,
14991499 _ => None ,
15001500 } ,
15011501 suggestion : suggested_name. map ( |suggested_name| InvalidAbiSuggestion {
0 commit comments