aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-03-18 20:53:19 +0000
committerFlorian Diebold <[email protected]>2021-03-18 20:53:19 +0000
commit7a7e47eab7323a8e122d9994b2936e50e42a1af2 (patch)
treea2ad2b6faf8c708fc593546df64d489c117b61f2 /crates/hir
parentb70bea0d7994cbe7b1e01e6b2e0f4ab3ac2c6fd5 (diff)
Chalkify TraitRef
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/src/lib.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 95cfde61c..67ec8e82a 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -1462,7 +1462,7 @@ impl TypeParam {
1462 .into_iter() 1462 .into_iter()
1463 .filter_map(|pred| match &pred.value { 1463 .filter_map(|pred| match &pred.value {
1464 hir_ty::GenericPredicate::Implemented(trait_ref) => { 1464 hir_ty::GenericPredicate::Implemented(trait_ref) => {
1465 Some(Trait::from(trait_ref.trait_)) 1465 Some(Trait::from(trait_ref.hir_trait_id()))
1466 } 1466 }
1467 _ => None, 1467 _ => None,
1468 }) 1468 })
@@ -1757,8 +1757,8 @@ impl Type {
1757 1757
1758 pub fn impls_trait(&self, db: &dyn HirDatabase, trait_: Trait, args: &[Type]) -> bool { 1758 pub fn impls_trait(&self, db: &dyn HirDatabase, trait_: Trait, args: &[Type]) -> bool {
1759 let trait_ref = hir_ty::TraitRef { 1759 let trait_ref = hir_ty::TraitRef {
1760 trait_: trait_.id, 1760 trait_id: hir_ty::to_chalk_trait_id(trait_.id),
1761 substs: Substitution::build_for_def(db, trait_.id) 1761 substitution: Substitution::build_for_def(db, trait_.id)
1762 .push(self.ty.value.clone()) 1762 .push(self.ty.value.clone())
1763 .fill(args.iter().map(|t| t.ty.value.clone())) 1763 .fill(args.iter().map(|t| t.ty.value.clone()))
1764 .build(), 1764 .build(),
@@ -2023,7 +2023,7 @@ impl Type {
2023 it.into_iter() 2023 it.into_iter()
2024 .filter_map(|pred| match pred { 2024 .filter_map(|pred| match pred {
2025 hir_ty::GenericPredicate::Implemented(trait_ref) => { 2025 hir_ty::GenericPredicate::Implemented(trait_ref) => {
2026 Some(Trait::from(trait_ref.trait_)) 2026 Some(Trait::from(trait_ref.hir_trait_id()))
2027 } 2027 }
2028 _ => None, 2028 _ => None,
2029 }) 2029 })
@@ -2067,7 +2067,7 @@ impl Type {
2067 match pred { 2067 match pred {
2068 GenericPredicate::Implemented(trait_ref) => { 2068 GenericPredicate::Implemented(trait_ref) => {
2069 cb(type_.clone()); 2069 cb(type_.clone());
2070 walk_substs(db, type_, &trait_ref.substs, cb); 2070 walk_substs(db, type_, &trait_ref.substitution, cb);
2071 } 2071 }
2072 _ => (), 2072 _ => (),
2073 } 2073 }