1
Fork 0

Address nits

- Remove the ValuePairs glob import
- Make DummyPairs -> ValuePairs::Dummy and make it bug more
- Fix WC
- Make interner return `impl IntoIterator`s
This commit is contained in:
Michael Goulet 2024-06-13 09:47:42 -04:00
parent a2fb2ebc17
commit c8e42065f0
9 changed files with 85 additions and 78 deletions

View file

@ -263,7 +263,7 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
fn bound_coroutine_hidden_types(
self,
def_id: DefId,
) -> impl Iterator<Item = ty::EarlyBinder<'tcx, ty::Binder<'tcx, Ty<'tcx>>>> {
) -> impl IntoIterator<Item = ty::EarlyBinder<'tcx, ty::Binder<'tcx, Ty<'tcx>>>> {
self.bound_coroutine_hidden_types(def_id)
}
@ -286,14 +286,14 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
fn item_bounds(
self,
def_id: DefId,
) -> ty::EarlyBinder<'tcx, impl Iterator<Item = ty::Clause<'tcx>>> {
) -> ty::EarlyBinder<'tcx, impl IntoIterator<Item = ty::Clause<'tcx>>> {
self.item_bounds(def_id).map_bound(IntoIterator::into_iter)
}
fn super_predicates_of(
self,
def_id: DefId,
) -> ty::EarlyBinder<'tcx, impl Iterator<Item = ty::Clause<'tcx>>> {
) -> ty::EarlyBinder<'tcx, impl IntoIterator<Item = ty::Clause<'tcx>>> {
ty::EarlyBinder::bind(
self.super_predicates_of(def_id).instantiate_identity(self).predicates.into_iter(),
)
@ -315,7 +315,7 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
)
}
fn associated_type_def_ids(self, def_id: DefId) -> impl Iterator<Item = DefId> {
fn associated_type_def_ids(self, def_id: DefId) -> impl IntoIterator<Item = DefId> {
self.associated_items(def_id)
.in_definition_order()
.filter(|assoc_item| matches!(assoc_item.kind, ty::AssocKind::Type))

View file

@ -49,6 +49,10 @@ impl<'tcx> rustc_type_ir::inherent::Predicate<TyCtxt<'tcx>> for Predicate<'tcx>
fn is_coinductive(self, interner: TyCtxt<'tcx>) -> bool {
self.is_coinductive(interner)
}
fn allow_normalization(self) -> bool {
self.allow_normalization()
}
}
impl<'tcx> rustc_type_ir::inherent::IntoKind for Predicate<'tcx> {