1
+ use rustc_abi:: ExternAbi ;
1
2
use rustc_ast:: ptr:: P ;
2
3
use rustc_ast:: visit:: AssocCtxt ;
3
4
use rustc_ast:: * ;
@@ -11,7 +12,6 @@ use rustc_middle::span_bug;
11
12
use rustc_middle:: ty:: { ResolverAstLowering , TyCtxt } ;
12
13
use rustc_span:: edit_distance:: find_best_match_for_name;
13
14
use rustc_span:: { DesugaringKind , Ident , Span , Symbol , kw, sym} ;
14
- use rustc_target:: spec:: abi;
15
15
use smallvec:: { SmallVec , smallvec} ;
16
16
use thin_vec:: ThinVec ;
17
17
use tracing:: instrument;
@@ -244,7 +244,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
244
244
ModKind :: Unloaded => panic ! ( "`mod` items should have been loaded by now" ) ,
245
245
} ,
246
246
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) ) ,
248
248
items : self
249
249
. arena
250
250
. alloc_from_iter ( fm. items . iter ( ) . map ( |x| self . lower_foreign_item_ref ( x) ) ) ,
@@ -1385,23 +1385,23 @@ impl<'hir> LoweringContext<'_, 'hir> {
1385
1385
}
1386
1386
}
1387
1387
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| {
1390
1390
self . error_on_invalid_abi ( abi, err) ;
1391
- abi :: Abi :: Rust
1391
+ ExternAbi :: Rust
1392
1392
} )
1393
1393
}
1394
1394
1395
- pub ( super ) fn lower_extern ( & mut self , ext : Extern ) -> abi :: Abi {
1395
+ pub ( super ) fn lower_extern ( & mut self , ext : Extern ) -> ExternAbi {
1396
1396
match ext {
1397
- Extern :: None => abi :: Abi :: Rust ,
1398
- Extern :: Implicit ( _) => abi :: Abi :: FALLBACK ,
1397
+ Extern :: None => ExternAbi :: Rust ,
1398
+ Extern :: Implicit ( _) => ExternAbi :: FALLBACK ,
1399
1399
Extern :: Explicit ( abi, _) => self . lower_abi ( abi) ,
1400
1400
}
1401
1401
}
1402
1402
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 )
1405
1405
. iter ( )
1406
1406
. map ( |s| Symbol :: intern ( s) )
1407
1407
. collect :: < Vec < _ > > ( ) ;
@@ -1410,7 +1410,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
1410
1410
abi : abi. symbol_unescaped ,
1411
1411
span : abi. span ,
1412
1412
explain : match err {
1413
- abi :: AbiUnsupported :: Reason { explain } => Some ( InvalidAbiReason ( explain) ) ,
1413
+ rustc_abi :: AbiUnsupported :: Reason { explain } => Some ( InvalidAbiReason ( explain) ) ,
1414
1414
_ => None ,
1415
1415
} ,
1416
1416
suggestion : suggested_name. map ( |suggested_name| InvalidAbiSuggestion {
0 commit comments