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/traits/chalk.rs | |
parent | b70bea0d7994cbe7b1e01e6b2e0f4ab3ac2c6fd5 (diff) |
Chalkify TraitRef
Diffstat (limited to 'crates/hir_ty/src/traits/chalk.rs')
-rw-r--r-- | crates/hir_ty/src/traits/chalk.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs index bef6e7e9c..bac70f5aa 100644 --- a/crates/hir_ty/src/traits/chalk.rs +++ b/crates/hir_ty/src/traits/chalk.rs | |||
@@ -19,7 +19,7 @@ use crate::{ | |||
19 | display::HirDisplay, | 19 | display::HirDisplay, |
20 | from_assoc_type_id, | 20 | from_assoc_type_id, |
21 | method_resolution::{TyFingerprint, ALL_FLOAT_FPS, ALL_INT_FPS}, | 21 | method_resolution::{TyFingerprint, ALL_FLOAT_FPS, ALL_INT_FPS}, |
22 | to_assoc_type_id, | 22 | to_assoc_type_id, to_chalk_trait_id, |
23 | utils::generics, | 23 | utils::generics, |
24 | BoundVar, CallableDefId, CallableSig, DebruijnIndex, FnDefId, GenericPredicate, | 24 | BoundVar, CallableDefId, CallableSig, DebruijnIndex, FnDefId, GenericPredicate, |
25 | ProjectionPredicate, ProjectionTy, Substitution, TraitRef, Ty, TyKind, | 25 | ProjectionPredicate, ProjectionTy, Substitution, TraitRef, Ty, TyKind, |
@@ -219,9 +219,9 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> { | |||
219 | // for<T> <Self> [Future<Self>, Future::Output<Self> = T] | 219 | // for<T> <Self> [Future<Self>, Future::Output<Self> = T] |
220 | // ^1 ^0 ^0 ^0 ^1 | 220 | // ^1 ^0 ^0 ^0 ^1 |
221 | let impl_bound = GenericPredicate::Implemented(TraitRef { | 221 | let impl_bound = GenericPredicate::Implemented(TraitRef { |
222 | trait_: future_trait, | 222 | trait_id: to_chalk_trait_id(future_trait), |
223 | // Self type as the first parameter. | 223 | // Self type as the first parameter. |
224 | substs: Substitution::single( | 224 | substitution: Substitution::single( |
225 | TyKind::BoundVar(BoundVar { | 225 | TyKind::BoundVar(BoundVar { |
226 | debruijn: DebruijnIndex::INNERMOST, | 226 | debruijn: DebruijnIndex::INNERMOST, |
227 | index: 0, | 227 | index: 0, |
@@ -546,7 +546,7 @@ fn impl_def_datum( | |||
546 | 546 | ||
547 | let generic_params = generics(db.upcast(), impl_id.into()); | 547 | let generic_params = generics(db.upcast(), impl_id.into()); |
548 | let bound_vars = Substitution::bound_vars(&generic_params, DebruijnIndex::INNERMOST); | 548 | let bound_vars = Substitution::bound_vars(&generic_params, DebruijnIndex::INNERMOST); |
549 | let trait_ = trait_ref.trait_; | 549 | let trait_ = trait_ref.hir_trait_id(); |
550 | let impl_type = if impl_id.lookup(db.upcast()).container.krate() == krate { | 550 | let impl_type = if impl_id.lookup(db.upcast()).container.krate() == krate { |
551 | rust_ir::ImplType::Local | 551 | rust_ir::ImplType::Local |
552 | } else { | 552 | } else { |
@@ -614,7 +614,7 @@ fn type_alias_associated_ty_value( | |||
614 | let trait_ref = db.impl_trait(impl_id).expect("assoc ty value should not exist").value; // we don't return any assoc ty values if the impl'd trait can't be resolved | 614 | let trait_ref = db.impl_trait(impl_id).expect("assoc ty value should not exist").value; // we don't return any assoc ty values if the impl'd trait can't be resolved |
615 | 615 | ||
616 | let assoc_ty = db | 616 | let assoc_ty = db |
617 | .trait_data(trait_ref.trait_) | 617 | .trait_data(trait_ref.hir_trait_id()) |
618 | .associated_type_by_name(&type_alias_data.name) | 618 | .associated_type_by_name(&type_alias_data.name) |
619 | .expect("assoc ty value should not exist"); // validated when building the impl data as well | 619 | .expect("assoc ty value should not exist"); // validated when building the impl data as well |
620 | let ty = db.ty(type_alias.into()); | 620 | let ty = db.ty(type_alias.into()); |