@@ -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 :: {
@@ -1482,8 +1481,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
1482
1481
1483
1482
pub ( super ) fn lower_abi ( & mut self , abi_str : StrLit ) -> ExternAbi {
1484
1483
let ast:: StrLit { symbol_unescaped, span, .. } = abi_str;
1485
- let extern_abi = rustc_abi:: lookup ( symbol_unescaped. as_str ( ) ) . unwrap_or_else ( |err | {
1486
- self . error_on_invalid_abi ( abi_str, err ) ;
1484
+ let extern_abi = rustc_abi:: lookup ( symbol_unescaped. as_str ( ) ) . unwrap_or_else ( |_ | {
1485
+ self . error_on_invalid_abi ( abi_str) ;
1487
1486
ExternAbi :: Rust
1488
1487
} ) ;
1489
1488
let sess = self . tcx . sess ;
@@ -1500,7 +1499,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
1500
1499
}
1501
1500
}
1502
1501
1503
- fn error_on_invalid_abi ( & self , abi : StrLit , err : rustc_abi :: AbiUnsupported ) {
1502
+ fn error_on_invalid_abi ( & self , abi : StrLit ) {
1504
1503
let abi_names = enabled_names ( self . tcx . features ( ) , abi. span )
1505
1504
. iter ( )
1506
1505
. map ( |s| Symbol :: intern ( s) )
@@ -1509,10 +1508,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
1509
1508
self . dcx ( ) . emit_err ( InvalidAbi {
1510
1509
abi : abi. symbol_unescaped ,
1511
1510
span : abi. span ,
1512
- explain : match err {
1513
- rustc_abi:: AbiUnsupported :: Reason { explain } => Some ( InvalidAbiReason ( explain) ) ,
1514
- _ => None ,
1515
- } ,
1516
1511
suggestion : suggested_name. map ( |suggested_name| InvalidAbiSuggestion {
1517
1512
span : abi. span ,
1518
1513
suggestion : format ! ( "\" {suggested_name}\" " ) ,
0 commit comments