File tree Expand file tree Collapse file tree 3 files changed +13
-11
lines changed Expand file tree Collapse file tree 3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -1955,9 +1955,12 @@ impl<'tcx> Ty<'tcx> {
19551955}
19561956
19571957impl < ' tcx > rustc_type_ir:: inherent:: Tys < TyCtxt < ' tcx > > for & ' tcx ty:: List < Ty < ' tcx > > {
1958- fn split_inputs_and_output ( self ) -> ( & ' tcx [ Ty < ' tcx > ] , Ty < ' tcx > ) {
1959- let ( output, inputs) = self . split_last ( ) . unwrap ( ) ;
1960- ( inputs, * output)
1958+ fn inputs ( self ) -> & ' tcx [ Ty < ' tcx > ] {
1959+ self . split_last ( ) . unwrap ( ) . 1
1960+ }
1961+
1962+ fn output ( self ) -> Ty < ' tcx > {
1963+ * self . split_last ( ) . unwrap ( ) . 0
19611964 }
19621965}
19631966
Original file line number Diff line number Diff line change @@ -203,7 +203,9 @@ pub trait Ty<I: Interner<Ty = Self>>:
203203pub trait Tys < I : Interner < Tys = Self > > :
204204 Copy + Debug + Hash + Eq + SliceLike < Item = I :: Ty > + TypeFoldable < I > + Default
205205{
206- fn split_inputs_and_output ( self ) -> ( I :: FnInputTys , I :: Ty ) ;
206+ fn inputs ( self ) -> I :: FnInputTys ;
207+
208+ fn output ( self ) -> I :: Ty ;
207209}
208210
209211pub trait Abi < I : Interner < Abi = Self > > : Copy + Debug + Hash + Eq + Relate < I > {
Original file line number Diff line number Diff line change @@ -868,16 +868,12 @@ pub struct FnSig<I: Interner> {
868868}
869869
870870impl < I : Interner > FnSig < I > {
871- pub fn split_inputs_and_output ( self ) -> ( I :: FnInputTys , I :: Ty ) {
872- self . inputs_and_output . split_inputs_and_output ( )
873- }
874-
875871 pub fn inputs ( self ) -> I :: FnInputTys {
876- self . split_inputs_and_output ( ) . 0
872+ self . inputs_and_output . inputs ( )
877873 }
878874
879875 pub fn output ( self ) -> I :: Ty {
880- self . split_inputs_and_output ( ) . 1
876+ self . inputs_and_output . output ( )
881877 }
882878
883879 pub fn is_fn_trait_compatible ( self ) -> bool {
@@ -935,7 +931,7 @@ impl<I: Interner> fmt::Debug for FnSig<I> {
935931 }
936932
937933 write ! ( f, "fn(" ) ?;
938- let ( inputs, output ) = sig. split_inputs_and_output ( ) ;
934+ let inputs = sig. inputs ( ) ;
939935 for ( i, ty) in inputs. iter ( ) . enumerate ( ) {
940936 if i > 0 {
941937 write ! ( f, ", " ) ?;
@@ -951,6 +947,7 @@ impl<I: Interner> fmt::Debug for FnSig<I> {
951947 }
952948 write ! ( f, ")" ) ?;
953949
950+ let output = sig. output ( ) ;
954951 match output. kind ( ) {
955952 Tuple ( list) if list. is_empty ( ) => Ok ( ( ) ) ,
956953 _ => write ! ( f, " -> {:?}" , sig. output( ) ) ,
You can’t perform that action at this time.
0 commit comments