@@ -17,8 +17,7 @@ use thin_vec::ThinVec;
1717use tracing:: instrument;
1818
1919use super :: errors:: {
20- InvalidAbi , InvalidAbiReason , InvalidAbiSuggestion , MisplacedRelaxTraitBound ,
21- TupleStructWithDefault ,
20+ InvalidAbi , InvalidAbiSuggestion , MisplacedRelaxTraitBound , TupleStructWithDefault ,
2221} ;
2322use super :: stability:: { enabled_names, gate_unstable_abi} ;
2423use super :: {
@@ -1482,8 +1481,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
14821481
14831482 pub ( super ) fn lower_abi ( & mut self , abi_str : StrLit ) -> ExternAbi {
14841483 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) ;
14871486 ExternAbi :: Rust
14881487 } ) ;
14891488 let sess = self . tcx . sess ;
@@ -1500,7 +1499,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
15001499 }
15011500 }
15021501
1503- fn error_on_invalid_abi ( & self , abi : StrLit , err : rustc_abi :: AbiUnsupported ) {
1502+ fn error_on_invalid_abi ( & self , abi : StrLit ) {
15041503 let abi_names = enabled_names ( self . tcx . features ( ) , abi. span )
15051504 . iter ( )
15061505 . map ( |s| Symbol :: intern ( s) )
@@ -1509,10 +1508,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
15091508 self . dcx ( ) . emit_err ( InvalidAbi {
15101509 abi : abi. symbol_unescaped ,
15111510 span : abi. span ,
1512- explain : match err {
1513- rustc_abi:: AbiUnsupported :: Reason { explain } => Some ( InvalidAbiReason ( explain) ) ,
1514- _ => None ,
1515- } ,
15161511 suggestion : suggested_name. map ( |suggested_name| InvalidAbiSuggestion {
15171512 span : abi. span ,
15181513 suggestion : format ! ( "\" {suggested_name}\" " ) ,
0 commit comments