@@ -6,7 +6,6 @@ use rustc_abi::{
6
6
Size , TyAbiInterface , TyAndLayout ,
7
7
} ;
8
8
use rustc_macros:: HashStable_Generic ;
9
- use rustc_span:: Symbol ;
10
9
11
10
use crate :: spec:: { HasTargetSpec , HasWasmCAbiOpt , HasX86AbiOpt , WasmCAbi } ;
12
11
@@ -623,19 +622,8 @@ impl<'a, Ty: fmt::Display> fmt::Debug for FnAbi<'a, Ty> {
623
622
}
624
623
}
625
624
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
-
633
625
impl < ' 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 )
639
627
where
640
628
Ty : TyAbiInterface < ' a , C > + Copy ,
641
629
C : HasDataLayout + HasTargetSpec + HasWasmCAbiOpt + HasX86AbiOpt ,
@@ -644,7 +632,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
644
632
if let Some ( arg) = self . args . first_mut ( ) {
645
633
arg. pass_by_stack_offset ( None ) ;
646
634
}
647
- return Ok ( ( ) ) ;
635
+ return ;
648
636
}
649
637
650
638
let spec = cx. target_spec ( ) ;
@@ -719,15 +707,8 @@ impl<'a, Ty> FnAbi<'a, Ty> {
719
707
}
720
708
"wasm64" => wasm:: compute_c_abi_info ( cx, self ) ,
721
709
"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}" ) ,
728
711
}
729
-
730
- Ok ( ( ) )
731
712
}
732
713
733
714
pub fn adjust_for_rust_abi < C > ( & mut self , cx : & C , abi : ExternAbi )
0 commit comments