diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-20 11:47:50 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-20 11:47:50 +0000 |
commit | 4d67032bbb3e1f97ee7af43cb6f056d01f791ca2 (patch) | |
tree | 70a77a26ca09d8d5cd843b1cd9d59af229cd0daf /crates/hir_ty/src/infer/path.rs | |
parent | 5ac0290f533eed295c6e92564d7530d41cf45d6e (diff) | |
parent | 7ec3b66f7a3ac0a33cf435bc3596fdac542fc52a (diff) |
Merge #8117
8117: Turn Obligation into something similar to chalk_ir::DomainGoal r=flodiebold a=flodiebold
This includes starting to make use of Chalk's `Cast` trait.
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/infer/path.rs')
-rw-r--r-- | crates/hir_ty/src/infer/path.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/crates/hir_ty/src/infer/path.rs b/crates/hir_ty/src/infer/path.rs index e15135fc1..58cce56ab 100644 --- a/crates/hir_ty/src/infer/path.rs +++ b/crates/hir_ty/src/infer/path.rs | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | use std::iter; | 3 | use std::iter; |
4 | 4 | ||
5 | use chalk_ir::cast::Cast; | ||
5 | use hir_def::{ | 6 | use hir_def::{ |
6 | path::{Path, PathSegment}, | 7 | path::{Path, PathSegment}, |
7 | resolver::{ResolveValueResult, Resolver, TypeNs, ValueNs}, | 8 | resolver::{ResolveValueResult, Resolver, TypeNs, ValueNs}, |
@@ -256,10 +257,13 @@ impl<'a> InferenceContext<'a> { | |||
256 | .push(ty.clone()) | 257 | .push(ty.clone()) |
257 | .fill(std::iter::repeat_with(|| self.table.new_type_var())) | 258 | .fill(std::iter::repeat_with(|| self.table.new_type_var())) |
258 | .build(); | 259 | .build(); |
259 | self.obligations.push(super::Obligation::Trait(TraitRef { | 260 | self.obligations.push( |
260 | trait_id: to_chalk_trait_id(trait_), | 261 | TraitRef { |
261 | substitution: trait_substs.clone(), | 262 | trait_id: to_chalk_trait_id(trait_), |
262 | })); | 263 | substitution: trait_substs.clone(), |
264 | } | ||
265 | .cast(&Interner), | ||
266 | ); | ||
263 | Some(trait_substs) | 267 | Some(trait_substs) |
264 | } | 268 | } |
265 | AssocContainerId::ModuleId(_) => None, | 269 | AssocContainerId::ModuleId(_) => None, |