diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 73e07dcd592..0ee190302ac 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -2516,7 +2516,7 @@ pub fn intern_tup(self, ts: &[Ty<'tcx>]) -> Ty<'tcx> { self.mk_ty(Tuple(self.intern_type_list(&ts))) } - pub fn mk_tup], Ty<'tcx>>>(self, iter: I) -> I::Output { + pub fn mk_tup, Ty<'tcx>>>(self, iter: I) -> I::Output { iter.intern_with(|ts| self.mk_ty(Tuple(self.intern_type_list(&ts)))) } @@ -2776,7 +2776,7 @@ pub fn mk_fn_sig( } pub fn mk_poly_existential_predicates< - I: InternAs<[PolyExistentialPredicate<'tcx>], &'tcx List>>, + I: InternAs, &'tcx List>>, >( self, iter: I, @@ -2784,25 +2784,25 @@ pub fn mk_poly_existential_predicates< iter.intern_with(|xs| self.intern_poly_existential_predicates(xs)) } - pub fn mk_predicates], &'tcx List>>>( + pub fn mk_predicates, &'tcx List>>>( self, iter: I, ) -> I::Output { iter.intern_with(|xs| self.intern_predicates(xs)) } - pub fn mk_type_list], &'tcx List>>>(self, iter: I) -> I::Output { + pub fn mk_type_list, &'tcx List>>>(self, iter: I) -> I::Output { iter.intern_with(|xs| self.intern_type_list(xs)) } - pub fn mk_substs], &'tcx List>>>( + pub fn mk_substs, &'tcx List>>>( self, iter: I, ) -> I::Output { iter.intern_with(|xs| self.intern_substs(xs)) } - pub fn mk_place_elems], &'tcx List>>>( + pub fn mk_place_elems, &'tcx List>>>( self, iter: I, ) -> I::Output { @@ -2835,7 +2835,7 @@ pub fn mk_trait_ref( } pub fn mk_bound_variable_kinds< - I: InternAs<[ty::BoundVariableKind], &'tcx List>, + I: InternAs>, >( self, iter: I, diff --git a/compiler/rustc_type_ir/src/lib.rs b/compiler/rustc_type_ir/src/lib.rs index 7c3eb4efbc9..581993ba7d8 100644 --- a/compiler/rustc_type_ir/src/lib.rs +++ b/compiler/rustc_type_ir/src/lib.rs @@ -60,10 +60,10 @@ pub trait InternAs { type Output; fn intern_with(self, f: F) -> Self::Output where - F: FnOnce(&T) -> R; + F: FnOnce(&[T]) -> R; } -impl InternAs<[T], R> for I +impl InternAs for I where E: InternIteratorElement, I: Iterator,