diff options
author | Florian Diebold <[email protected]> | 2021-03-18 20:53:19 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-03-18 20:53:19 +0000 |
commit | 7a7e47eab7323a8e122d9994b2936e50e42a1af2 (patch) | |
tree | a2ad2b6faf8c708fc593546df64d489c117b61f2 /crates/hir_ty/src/method_resolution.rs | |
parent | b70bea0d7994cbe7b1e01e6b2e0f4ab3ac2c6fd5 (diff) |
Chalkify TraitRef
Diffstat (limited to 'crates/hir_ty/src/method_resolution.rs')
-rw-r--r-- | crates/hir_ty/src/method_resolution.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs index 943d3339b..01b78fb44 100644 --- a/crates/hir_ty/src/method_resolution.rs +++ b/crates/hir_ty/src/method_resolution.rs | |||
@@ -19,6 +19,7 @@ use crate::{ | |||
19 | db::HirDatabase, | 19 | db::HirDatabase, |
20 | from_foreign_def_id, | 20 | from_foreign_def_id, |
21 | primitive::{self, FloatTy, IntTy, UintTy}, | 21 | primitive::{self, FloatTy, IntTy, UintTy}, |
22 | to_chalk_trait_id, | ||
22 | utils::all_super_traits, | 23 | utils::all_super_traits, |
23 | AdtId, Canonical, DebruijnIndex, FnPointer, FnSig, ForeignDefId, InEnvironment, Interner, | 24 | AdtId, Canonical, DebruijnIndex, FnPointer, FnSig, ForeignDefId, InEnvironment, Interner, |
24 | Scalar, Substitution, TraitEnvironment, TraitRef, Ty, TyKind, TypeWalk, | 25 | Scalar, Substitution, TraitEnvironment, TraitRef, Ty, TyKind, TypeWalk, |
@@ -101,7 +102,7 @@ impl TraitImpls { | |||
101 | for (_module_id, module_data) in crate_def_map.modules() { | 102 | for (_module_id, module_data) in crate_def_map.modules() { |
102 | for impl_id in module_data.scope.impls() { | 103 | for impl_id in module_data.scope.impls() { |
103 | let target_trait = match db.impl_trait(impl_id) { | 104 | let target_trait = match db.impl_trait(impl_id) { |
104 | Some(tr) => tr.value.trait_, | 105 | Some(tr) => tr.value.hir_trait_id(), |
105 | None => continue, | 106 | None => continue, |
106 | }; | 107 | }; |
107 | let self_ty = db.impl_self_ty(impl_id); | 108 | let self_ty = db.impl_self_ty(impl_id); |
@@ -773,7 +774,7 @@ fn generic_implements_goal( | |||
773 | .fill_with_bound_vars(DebruijnIndex::INNERMOST, kinds.len()) | 774 | .fill_with_bound_vars(DebruijnIndex::INNERMOST, kinds.len()) |
774 | .build(); | 775 | .build(); |
775 | kinds.extend(iter::repeat(chalk_ir::TyVariableKind::General).take(substs.len() - 1)); | 776 | kinds.extend(iter::repeat(chalk_ir::TyVariableKind::General).take(substs.len() - 1)); |
776 | let trait_ref = TraitRef { trait_, substs }; | 777 | let trait_ref = TraitRef { trait_id: to_chalk_trait_id(trait_), substitution: substs }; |
777 | let obligation = super::Obligation::Trait(trait_ref); | 778 | let obligation = super::Obligation::Trait(trait_ref); |
778 | Canonical { kinds: kinds.into(), value: InEnvironment::new(env, obligation) } | 779 | Canonical { kinds: kinds.into(), value: InEnvironment::new(env, obligation) } |
779 | } | 780 | } |