Use newtype_index!-generated types more idiomatically

This commit is contained in:
Yotam Ofek
2025-04-14 15:52:25 +00:00
parent c580c498a1
commit 4b63362f3d
20 changed files with 61 additions and 87 deletions

View File

@@ -606,7 +606,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
// with placeholders, which imply nothing about outlives bounds, and then
// prove below that the hidden types are well formed.
let universe = infcx.create_next_universe();
let mut idx = 0;
let mut idx = ty::BoundVar::ZERO;
let mapping: FxIndexMap<_, _> = collector
.types
.iter()
@@ -623,10 +623,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
tcx,
ty::Placeholder {
universe,
bound: ty::BoundTy {
var: ty::BoundVar::from_usize(idx),
kind: ty::BoundTyKind::Anon,
},
bound: ty::BoundTy { var: idx, kind: ty::BoundTyKind::Anon },
},
),
)