From a4d7bdf1c884a9f3dd415a882fa56422adae89bf Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 4 Apr 2021 13:07:06 +0200 Subject: Replace Substitution::bound_vars and ::type_params_for_generics --- crates/hir_ty/src/traits/chalk.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/hir_ty/src/traits') diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs index 36a397990..541e6082f 100644 --- a/crates/hir_ty/src/traits/chalk.rs +++ b/crates/hir_ty/src/traits/chalk.rs @@ -387,7 +387,7 @@ pub(crate) fn associated_ty_data_query( // Lower bounds -- we could/should maybe move this to a separate query in `lower` let type_alias_data = db.type_alias_data(type_alias); let generic_params = generics(db.upcast(), type_alias.into()); - let bound_vars = Substitution::bound_vars(&generic_params, DebruijnIndex::INNERMOST); + let bound_vars = generic_params.bound_vars_subst(DebruijnIndex::INNERMOST); let resolver = hir_def::resolver::HasResolver::resolver(type_alias, db.upcast()); let ctx = crate::TyLoweringContext::new(db, &resolver) .with_type_param_mode(crate::lower::TypeParamLoweringMode::Variable); @@ -421,7 +421,7 @@ pub(crate) fn trait_datum_query( let trait_data = db.trait_data(trait_); debug!("trait {:?} = {:?}", trait_id, trait_data.name); let generic_params = generics(db.upcast(), trait_.into()); - let bound_vars = Substitution::bound_vars(&generic_params, DebruijnIndex::INNERMOST); + let bound_vars = generic_params.bound_vars_subst(DebruijnIndex::INNERMOST); let flags = rust_ir::TraitFlags { auto: trait_data.is_auto, upstream: trait_.lookup(db.upcast()).container.krate() != krate, @@ -490,7 +490,7 @@ pub(crate) fn struct_datum_query( let upstream = adt_id.module(db.upcast()).krate() != krate; let where_clauses = { let generic_params = generics(db.upcast(), adt_id.into()); - let bound_vars = Substitution::bound_vars(&generic_params, DebruijnIndex::INNERMOST); + let bound_vars = generic_params.bound_vars_subst(DebruijnIndex::INNERMOST); convert_where_clauses(db, adt_id.into(), &bound_vars) }; let flags = rust_ir::AdtFlags { @@ -539,7 +539,7 @@ fn impl_def_datum( let impl_data = db.impl_data(impl_id); let generic_params = generics(db.upcast(), impl_id.into()); - let bound_vars = Substitution::bound_vars(&generic_params, DebruijnIndex::INNERMOST); + let bound_vars = generic_params.bound_vars_subst(DebruijnIndex::INNERMOST); let trait_ = trait_ref.hir_trait_id(); let impl_type = if impl_id.lookup(db.upcast()).container.krate() == krate { rust_ir::ImplType::Local @@ -629,7 +629,7 @@ pub(crate) fn fn_def_datum_query( let callable_def: CallableDefId = from_chalk(db, fn_def_id); let generic_params = generics(db.upcast(), callable_def.into()); let sig = db.callable_item_signature(callable_def); - let bound_vars = Substitution::bound_vars(&generic_params, DebruijnIndex::INNERMOST); + let bound_vars = generic_params.bound_vars_subst(DebruijnIndex::INNERMOST); let where_clauses = convert_where_clauses(db, callable_def.into(), &bound_vars); let bound = rust_ir::FnDefDatumBound { // Note: Chalk doesn't actually use this information yet as far as I am aware, but we provide it anyway -- cgit v1.2.3