diff options
author | Florian Diebold <[email protected]> | 2021-05-16 14:50:28 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-05-21 16:48:34 +0100 |
commit | 1250ddc5cf58ff0a6bbf7c07e5bd9f7cc7db5a09 (patch) | |
tree | 51c6ed040c2b1ec6b33321501ced866d87701c71 /crates/hir_ty/src/lower.rs | |
parent | a3d9cac69057db700c4f6e01b84dc59529ea6dfd (diff) |
Rework obligation handling
We can't do the easy hack that we did before anymore, where we kept
track of whether any inference variables changed since the last time we
rechecked obligations. Instead, we store the obligations in
canonicalized form; that way we can easily check the inference variables
to see whether they have changed since the goal was canonicalized.
Diffstat (limited to 'crates/hir_ty/src/lower.rs')
-rw-r--r-- | crates/hir_ty/src/lower.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs index bd8bb6028..8a375b973 100644 --- a/crates/hir_ty/src/lower.rs +++ b/crates/hir_ty/src/lower.rs | |||
@@ -1035,9 +1035,11 @@ pub(crate) fn trait_environment_query( | |||
1035 | clauses.push(program_clause.into_from_env_clause(&Interner)); | 1035 | clauses.push(program_clause.into_from_env_clause(&Interner)); |
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | let krate = def.module(db.upcast()).krate(); | ||
1039 | |||
1038 | let env = chalk_ir::Environment::new(&Interner).add_clauses(&Interner, clauses); | 1040 | let env = chalk_ir::Environment::new(&Interner).add_clauses(&Interner, clauses); |
1039 | 1041 | ||
1040 | Arc::new(TraitEnvironment { traits_from_clauses: traits_in_scope, env }) | 1042 | Arc::new(TraitEnvironment { krate, traits_from_clauses: traits_in_scope, env }) |
1041 | } | 1043 | } |
1042 | 1044 | ||
1043 | /// Resolve the where clause(s) of an item with generics. | 1045 | /// Resolve the where clause(s) of an item with generics. |