@@ -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 :: {
@@ -1473,8 +1472,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
14731472
14741473 pub ( super ) fn lower_abi ( & mut self , abi_str : StrLit ) -> ExternAbi {
14751474 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) ;
14781477 ExternAbi :: Rust
14791478 } ) ;
14801479 let sess = self . tcx . sess ;
@@ -1491,7 +1490,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
14911490 }
14921491 }
14931492
1494- fn error_on_invalid_abi ( & self , abi : StrLit , err : rustc_abi :: AbiUnsupported ) {
1493+ fn error_on_invalid_abi ( & self , abi : StrLit ) {
14951494 let abi_names = enabled_names ( self . tcx . features ( ) , abi. span )
14961495 . iter ( )
14971496 . map ( |s| Symbol :: intern ( s) )
@@ -1500,10 +1499,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
15001499 self . dcx ( ) . emit_err ( InvalidAbi {
15011500 abi : abi. symbol_unescaped ,
15021501 span : abi. span ,
1503- explain : match err {
1504- rustc_abi:: AbiUnsupported :: Reason { explain } => Some ( InvalidAbiReason ( explain) ) ,
1505- _ => None ,
1506- } ,
15071502 suggestion : suggested_name. map ( |suggested_name| InvalidAbiSuggestion {
15081503 span : abi. span ,
15091504 suggestion : format ! ( "\" {suggested_name}\" " ) ,
0 commit comments