File tree 3 files changed +13
-11
lines changed
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> {
1955
1955
}
1956
1956
1957
1957
impl < ' 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
1961
1964
}
1962
1965
}
1963
1966
Original file line number Diff line number Diff line change @@ -203,7 +203,9 @@ pub trait Ty<I: Interner<Ty = Self>>:
203
203
pub trait Tys < I : Interner < Tys = Self > > :
204
204
Copy + Debug + Hash + Eq + SliceLike < Item = I :: Ty > + TypeFoldable < I > + Default
205
205
{
206
- fn split_inputs_and_output ( self ) -> ( I :: FnInputTys , I :: Ty ) ;
206
+ fn inputs ( self ) -> I :: FnInputTys ;
207
+
208
+ fn output ( self ) -> I :: Ty ;
207
209
}
208
210
209
211
pub 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> {
868
868
}
869
869
870
870
impl < 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
-
875
871
pub fn inputs ( self ) -> I :: FnInputTys {
876
- self . split_inputs_and_output ( ) . 0
872
+ self . inputs_and_output . inputs ( )
877
873
}
878
874
879
875
pub fn output ( self ) -> I :: Ty {
880
- self . split_inputs_and_output ( ) . 1
876
+ self . inputs_and_output . output ( )
881
877
}
882
878
883
879
pub fn is_fn_trait_compatible ( self ) -> bool {
@@ -935,7 +931,7 @@ impl<I: Interner> fmt::Debug for FnSig<I> {
935
931
}
936
932
937
933
write ! ( f, "fn(" ) ?;
938
- let ( inputs, output ) = sig. split_inputs_and_output ( ) ;
934
+ let inputs = sig. inputs ( ) ;
939
935
for ( i, ty) in inputs. iter ( ) . enumerate ( ) {
940
936
if i > 0 {
941
937
write ! ( f, ", " ) ?;
@@ -951,6 +947,7 @@ impl<I: Interner> fmt::Debug for FnSig<I> {
951
947
}
952
948
write ! ( f, ")" ) ?;
953
949
950
+ let output = sig. output ( ) ;
954
951
match output. kind ( ) {
955
952
Tuple ( list) if list. is_empty ( ) => Ok ( ( ) ) ,
956
953
_ => write ! ( f, " -> {:?}" , sig. output( ) ) ,
You can’t perform that action at this time.
0 commit comments