Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/next_solver/util.rs')
| -rw-r--r-- | crates/hir-ty/src/next_solver/util.rs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/crates/hir-ty/src/next_solver/util.rs b/crates/hir-ty/src/next_solver/util.rs index c175062bda..858233cb2c 100644 --- a/crates/hir-ty/src/next_solver/util.rs +++ b/crates/hir-ty/src/next_solver/util.rs @@ -15,7 +15,7 @@ use rustc_type_ir::{ use crate::{ next_solver::{ - BoundConst, FxIndexMap, ParamEnv, Placeholder, PlaceholderConst, PlaceholderRegion, + BoundConst, FxIndexMap, ParamEnv, PlaceholderConst, PlaceholderRegion, PlaceholderType, PolyTraitRef, infer::{ InferCtxt, @@ -446,9 +446,10 @@ pub fn apply_args_to_binder<'db, T: TypeFoldable<DbInterner<'db>>>( args: GenericArgs<'db>, interner: DbInterner<'db>, ) -> T { - let types = &mut |ty: BoundTy| args.as_slice()[ty.var.index()].expect_ty(); - let regions = &mut |region: BoundRegion| args.as_slice()[region.var.index()].expect_region(); - let consts = &mut |const_: BoundConst| args.as_slice()[const_.var.index()].expect_const(); + let types = &mut |ty: BoundTy<'db>| args.as_slice()[ty.var.index()].expect_ty(); + let regions = + &mut |region: BoundRegion<'db>| args.as_slice()[region.var.index()].expect_region(); + let consts = &mut |const_: BoundConst<'db>| args.as_slice()[const_.var.index()].expect_const(); let mut instantiate = BoundVarReplacer::new(interner, FnMutDelegate { types, regions, consts }); b.skip_binder().fold_with(&mut instantiate) } @@ -497,9 +498,9 @@ impl<'db> TypeVisitor<DbInterner<'db>> for ContainsTypeErrors { /// The inverse of [`BoundVarReplacer`]: replaces placeholders with the bound vars from which they came. pub struct PlaceholderReplacer<'a, 'db> { infcx: &'a InferCtxt<'db>, - mapped_regions: FxIndexMap<PlaceholderRegion, BoundRegion>, - mapped_types: FxIndexMap<Placeholder<BoundTy>, BoundTy>, - mapped_consts: FxIndexMap<PlaceholderConst, BoundConst>, + mapped_regions: FxIndexMap<PlaceholderRegion<'db>, BoundRegion<'db>>, + mapped_types: FxIndexMap<PlaceholderType<'db>, BoundTy<'db>>, + mapped_consts: FxIndexMap<PlaceholderConst<'db>, BoundConst<'db>>, universe_indices: &'a [Option<UniverseIndex>], current_index: DebruijnIndex, } @@ -507,9 +508,9 @@ pub struct PlaceholderReplacer<'a, 'db> { impl<'a, 'db> PlaceholderReplacer<'a, 'db> { pub fn replace_placeholders<T: TypeFoldable<DbInterner<'db>>>( infcx: &'a InferCtxt<'db>, - mapped_regions: FxIndexMap<PlaceholderRegion, BoundRegion>, - mapped_types: FxIndexMap<Placeholder<BoundTy>, BoundTy>, - mapped_consts: FxIndexMap<PlaceholderConst, BoundConst>, + mapped_regions: FxIndexMap<PlaceholderRegion<'db>, BoundRegion<'db>>, + mapped_types: FxIndexMap<PlaceholderType<'db>, BoundTy<'db>>, + mapped_consts: FxIndexMap<PlaceholderConst<'db>, BoundConst<'db>>, universe_indices: &'a [Option<UniverseIndex>], value: T, ) -> T { |