@@ -6,7 +6,6 @@ use rustc_abi::{
66 Size , TyAbiInterface , TyAndLayout ,
77} ;
88use rustc_macros:: HashStable_Generic ;
9- use rustc_span:: Symbol ;
109
1110use crate :: spec:: { HasTargetSpec , HasWasmCAbiOpt , HasX86AbiOpt , WasmCAbi } ;
1211
@@ -623,19 +622,8 @@ impl<'a, Ty: fmt::Display> fmt::Debug for FnAbi<'a, Ty> {
623622 }
624623}
625624
626- /// Error produced by attempting to adjust a `FnAbi`, for a "foreign" ABI.
627- #[ derive( Copy , Clone , Debug , HashStable_Generic ) ]
628- pub enum AdjustForForeignAbiError {
629- /// Target architecture doesn't support "foreign" (i.e. non-Rust) ABIs.
630- Unsupported { arch : Symbol , abi : ExternAbi } ,
631- }
632-
633625impl < ' a , Ty > FnAbi < ' a , Ty > {
634- pub fn adjust_for_foreign_abi < C > (
635- & mut self ,
636- cx : & C ,
637- abi : ExternAbi ,
638- ) -> Result < ( ) , AdjustForForeignAbiError >
626+ pub fn adjust_for_foreign_abi < C > ( & mut self , cx : & C , abi : ExternAbi )
639627 where
640628 Ty : TyAbiInterface < ' a , C > + Copy ,
641629 C : HasDataLayout + HasTargetSpec + HasWasmCAbiOpt + HasX86AbiOpt ,
@@ -644,7 +632,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
644632 if let Some ( arg) = self . args . first_mut ( ) {
645633 arg. pass_by_stack_offset ( None ) ;
646634 }
647- return Ok ( ( ) ) ;
635+ return ;
648636 }
649637
650638 let spec = cx. target_spec ( ) ;
@@ -719,15 +707,8 @@ impl<'a, Ty> FnAbi<'a, Ty> {
719707 }
720708 "wasm64" => wasm:: compute_c_abi_info ( cx, self ) ,
721709 "bpf" => bpf:: compute_abi_info ( self ) ,
722- arch => {
723- return Err ( AdjustForForeignAbiError :: Unsupported {
724- arch : Symbol :: intern ( arch) ,
725- abi,
726- } ) ;
727- }
710+ arch => panic ! ( "no lowering implemented for {arch}" ) ,
728711 }
729-
730- Ok ( ( ) )
731712 }
732713
733714 pub fn adjust_for_rust_abi < C > ( & mut self , cx : & C , abi : ExternAbi )
0 commit comments