diff options
author | Florian Diebold <[email protected]> | 2021-04-04 12:16:16 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-04-04 12:16:39 +0100 |
commit | ebdfc932e74ff11c8c14c513614212b7c07bf400 (patch) | |
tree | 85263e70c101206330ed95c00ce226a61c098c0c /crates/hir_ty/src/lower.rs | |
parent | a4d7bdf1c884a9f3dd415a882fa56422adae89bf (diff) |
Replace Substitution::type_params
Diffstat (limited to 'crates/hir_ty/src/lower.rs')
-rw-r--r-- | crates/hir_ty/src/lower.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs index f9a721fdf..214655807 100644 --- a/crates/hir_ty/src/lower.rs +++ b/crates/hir_ty/src/lower.rs | |||
@@ -470,12 +470,13 @@ impl<'a> TyLoweringContext<'a> { | |||
470 | TypeParamLoweringMode::Placeholder => { | 470 | TypeParamLoweringMode::Placeholder => { |
471 | // if we're lowering to placeholders, we have to put | 471 | // if we're lowering to placeholders, we have to put |
472 | // them in now | 472 | // them in now |
473 | let s = Substitution::type_params( | 473 | let generics = generics( |
474 | self.db, | 474 | self.db.upcast(), |
475 | self.resolver.generic_def().expect( | 475 | self.resolver.generic_def().expect( |
476 | "there should be generics if there's a generic param", | 476 | "there should be generics if there's a generic param", |
477 | ), | 477 | ), |
478 | ); | 478 | ); |
479 | let s = generics.type_params_subst(self.db); | ||
479 | t.substitution.clone().subst_bound_vars(&s) | 480 | t.substitution.clone().subst_bound_vars(&s) |
480 | } | 481 | } |
481 | TypeParamLoweringMode::Variable => t.substitution.clone(), | 482 | TypeParamLoweringMode::Variable => t.substitution.clone(), |
@@ -963,7 +964,7 @@ pub(crate) fn trait_environment_query( | |||
963 | // function default implementations (and hypothetical code | 964 | // function default implementations (and hypothetical code |
964 | // inside consts or type aliases) | 965 | // inside consts or type aliases) |
965 | cov_mark::hit!(trait_self_implements_self); | 966 | cov_mark::hit!(trait_self_implements_self); |
966 | let substs = Substitution::type_params(db, trait_id); | 967 | let substs = TyBuilder::type_params_subst(db, trait_id); |
967 | let trait_ref = TraitRef { trait_id: to_chalk_trait_id(trait_id), substitution: substs }; | 968 | let trait_ref = TraitRef { trait_id: to_chalk_trait_id(trait_id), substitution: substs }; |
968 | let pred = WhereClause::Implemented(trait_ref); | 969 | let pred = WhereClause::Implemented(trait_ref); |
969 | let program_clause: chalk_ir::ProgramClause<Interner> = pred.to_chalk(db).cast(&Interner); | 970 | let program_clause: chalk_ir::ProgramClause<Interner> = pred.to_chalk(db).cast(&Interner); |