@@ -17,8 +17,7 @@ use thin_vec::ThinVec;
17
17
use tracing:: instrument;
18
18
19
19
use super :: errors:: {
20
- InvalidAbi , InvalidAbiReason , InvalidAbiSuggestion , MisplacedRelaxTraitBound ,
21
- TupleStructWithDefault ,
20
+ InvalidAbi , InvalidAbiSuggestion , MisplacedRelaxTraitBound , TupleStructWithDefault ,
22
21
} ;
23
22
use super :: stability:: { enabled_names, gate_unstable_abi} ;
24
23
use super :: {
@@ -1473,8 +1472,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
1473
1472
1474
1473
pub ( super ) fn lower_abi ( & mut self , abi_str : StrLit ) -> ExternAbi {
1475
1474
let ast:: StrLit { symbol_unescaped, span, .. } = abi_str;
1476
- let extern_abi = rustc_abi:: lookup ( symbol_unescaped. as_str ( ) ) . unwrap_or_else ( |err | {
1477
- self . error_on_invalid_abi ( abi_str, err ) ;
1475
+ let extern_abi = rustc_abi:: lookup ( symbol_unescaped. as_str ( ) ) . unwrap_or_else ( |_ | {
1476
+ self . error_on_invalid_abi ( abi_str) ;
1478
1477
ExternAbi :: Rust
1479
1478
} ) ;
1480
1479
let sess = self . tcx . sess ;
@@ -1491,7 +1490,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
1491
1490
}
1492
1491
}
1493
1492
1494
- fn error_on_invalid_abi ( & self , abi : StrLit , err : rustc_abi :: AbiUnsupported ) {
1493
+ fn error_on_invalid_abi ( & self , abi : StrLit ) {
1495
1494
let abi_names = enabled_names ( self . tcx . features ( ) , abi. span )
1496
1495
. iter ( )
1497
1496
. map ( |s| Symbol :: intern ( s) )
@@ -1500,10 +1499,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
1500
1499
self . dcx ( ) . emit_err ( InvalidAbi {
1501
1500
abi : abi. symbol_unescaped ,
1502
1501
span : abi. span ,
1503
- explain : match err {
1504
- rustc_abi:: AbiUnsupported :: Reason { explain } => Some ( InvalidAbiReason ( explain) ) ,
1505
- _ => None ,
1506
- } ,
1507
1502
suggestion : suggested_name. map ( |suggested_name| InvalidAbiSuggestion {
1508
1503
span : abi. span ,
1509
1504
suggestion : format ! ( "\" {suggested_name}\" " ) ,
0 commit comments