diff --git a/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs b/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs index d4890e48032..2df039c766c 100644 --- a/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs +++ b/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs @@ -258,7 +258,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable { if sig.is_fn_trait_compatible() { - Ok(Some(sig.map_bound(|sig| (Ty::new_tup(tcx, &sig.inputs()), sig.output())))) + Ok(Some( + sig.map_bound(|sig| (Ty::new_tup(tcx, sig.inputs().as_slice()), sig.output())), + )) } else { Err(NoSolution) } @@ -290,7 +292,9 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable; type Tys: Tys; - type FnInputTys: Copy + Debug + Hash + Eq + Deref + TypeVisitable; + type FnInputTys: Copy + Debug + Hash + Eq + SliceLike + TypeVisitable; type ParamTy: Copy + Debug + Hash + Eq + ParamLike; type BoundTy: Copy + Debug + Hash + Eq + BoundVarLike; type PlaceholderTy: PlaceholderLike; diff --git a/compiler/rustc_type_ir/src/predicate_kind.rs b/compiler/rustc_type_ir/src/predicate_kind.rs index efe270ed608..b1d0f8d19b3 100644 --- a/compiler/rustc_type_ir/src/predicate_kind.rs +++ b/compiler/rustc_type_ir/src/predicate_kind.rs @@ -127,7 +127,6 @@ impl std::fmt::Display for AliasRelationDirection { } } -// FIXME: Convert to DebugWithInfcx impl impl fmt::Debug for ClauseKind { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { @@ -144,7 +143,6 @@ impl fmt::Debug for ClauseKind { } } -// FIXME: Convert to DebugWithInfcx impl impl fmt::Debug for PredicateKind { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { diff --git a/compiler/rustc_type_ir/src/relate.rs b/compiler/rustc_type_ir/src/relate.rs index c803d7e1794..0439e7f857f 100644 --- a/compiler/rustc_type_ir/src/relate.rs +++ b/compiler/rustc_type_ir/src/relate.rs @@ -185,7 +185,7 @@ impl Relate for ty::FnSig { } let inputs_and_output = iter::zip(a_inputs.iter(), b_inputs.iter()) - .map(|(&a, &b)| ((a, b), false)) + .map(|(a, b)| ((a, b), false)) .chain(iter::once(((a.output(), b.output()), true))) .map(|((a, b), is_output)| { if is_output { diff --git a/compiler/rustc_type_ir/src/ty_kind.rs b/compiler/rustc_type_ir/src/ty_kind.rs index 4782b8558d7..4ffebef9f1f 100644 --- a/compiler/rustc_type_ir/src/ty_kind.rs +++ b/compiler/rustc_type_ir/src/ty_kind.rs @@ -1005,7 +1005,7 @@ impl ty::Binder> { #[inline] #[track_caller] pub fn input(self, index: usize) -> ty::Binder { - self.map_bound(|fn_sig| fn_sig.inputs()[index]) + self.map_bound(|fn_sig| fn_sig.inputs().get(index).unwrap()) } pub fn inputs_and_output(self) -> ty::Binder { diff --git a/compiler/rustc_type_ir/src/ty_kind/closure.rs b/compiler/rustc_type_ir/src/ty_kind/closure.rs index 04aadfdabb4..24a7c0c67e9 100644 --- a/compiler/rustc_type_ir/src/ty_kind/closure.rs +++ b/compiler/rustc_type_ir/src/ty_kind/closure.rs @@ -309,7 +309,7 @@ impl CoroutineClosureArgs { let interior = self.coroutine_witness_ty(); let ty::FnPtr(sig) = self.signature_parts_ty().kind() else { panic!() }; sig.map_bound(|sig| { - let [resume_ty, tupled_inputs_ty] = *sig.inputs() else { + let [resume_ty, tupled_inputs_ty] = *sig.inputs().as_slice() else { panic!(); }; let [yield_ty, return_ty] = *sig.output().tuple_fields().as_slice() else { panic!() };