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;
@@ -244,7 +244,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
244244 ModKind :: Unloaded => panic ! ( "`mod` items should have been loaded by now" ) ,
245245 } ,
246246 ItemKind :: ForeignMod ( fm) => hir:: ItemKind :: ForeignMod {
247- abi : fm. abi . map_or ( abi :: Abi :: FALLBACK , |abi| self . lower_abi ( abi) ) ,
247+ abi : fm. abi . map_or ( ExternAbi :: FALLBACK , |abi| self . lower_abi ( abi) ) ,
248248 items : self
249249 . arena
250250 . alloc_from_iter ( fm. items . iter ( ) . map ( |x| self . lower_foreign_item_ref ( x) ) ) ,
@@ -1385,23 +1385,23 @@ impl<'hir> LoweringContext<'_, 'hir> {
13851385 }
13861386 }
13871387
1388- pub ( super ) fn lower_abi ( & mut self , abi : StrLit ) -> abi :: Abi {
1389- abi :: lookup ( abi. symbol_unescaped . as_str ( ) ) . unwrap_or_else ( |err| {
1388+ pub ( super ) fn lower_abi ( & mut self , abi : StrLit ) -> ExternAbi {
1389+ rustc_abi :: lookup ( abi. symbol_unescaped . as_str ( ) ) . unwrap_or_else ( |err| {
13901390 self . error_on_invalid_abi ( abi, err) ;
1391- abi :: Abi :: Rust
1391+ ExternAbi :: Rust
13921392 } )
13931393 }
13941394
1395- pub ( super ) fn lower_extern ( & mut self , ext : Extern ) -> abi :: Abi {
1395+ pub ( super ) fn lower_extern ( & mut self , ext : Extern ) -> ExternAbi {
13961396 match ext {
1397- Extern :: None => abi :: Abi :: Rust ,
1398- Extern :: Implicit ( _) => abi :: Abi :: FALLBACK ,
1397+ Extern :: None => ExternAbi :: Rust ,
1398+ Extern :: Implicit ( _) => ExternAbi :: FALLBACK ,
13991399 Extern :: Explicit ( abi, _) => self . lower_abi ( abi) ,
14001400 }
14011401 }
14021402
1403- fn error_on_invalid_abi ( & self , abi : StrLit , err : abi :: AbiUnsupported ) {
1404- let abi_names = abi :: enabled_names ( self . tcx . features ( ) , abi. span )
1403+ fn error_on_invalid_abi ( & self , abi : StrLit , err : rustc_abi :: AbiUnsupported ) {
1404+ let abi_names = rustc_abi :: enabled_names ( self . tcx . features ( ) , abi. span )
14051405 . iter ( )
14061406 . map ( |s| Symbol :: intern ( s) )
14071407 . collect :: < Vec < _ > > ( ) ;
@@ -1410,7 +1410,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
14101410 abi : abi. symbol_unescaped ,
14111411 span : abi. span ,
14121412 explain : match err {
1413- abi :: AbiUnsupported :: Reason { explain } => Some ( InvalidAbiReason ( explain) ) ,
1413+ rustc_abi :: AbiUnsupported :: Reason { explain } => Some ( InvalidAbiReason ( explain) ) ,
14141414 _ => None ,
14151415 } ,
14161416 suggestion : suggested_name. map ( |suggested_name| InvalidAbiSuggestion {
0 commit comments