diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-12 21:20:36 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-12 21:20:36 +0100 |
commit | 39e049d2a1d7e0adbd9546f9e8124843443b31ce (patch) | |
tree | c4bd56eaa24b25db28d8f213bae39c3b47703c46 /crates/ra_hir_ty/src/traits/chalk/interner.rs | |
parent | ab1ad19f552e1b11055ed60f87cc420871d902eb (diff) | |
parent | d885f38011b6d4265b527744234b3c317fe86501 (diff) |
Merge #5319
5319: Chalk upgrade r=flodiebold a=flodiebold
- upgrade Chalk
- make use of Chalk's `Unsize` impls, remove ours
- use Chalk's built-in array type
- search efficiently for impls for an int/float variable
- output Chalk tracing logs in hir_ty tests
Fixes #2534.
Fixes #5057.
Fixes #4374.
Fixes #4281.
Co-authored-by: Florian Diebold <[email protected]>
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/traits/chalk/interner.rs')
-rw-r--r-- | crates/ra_hir_ty/src/traits/chalk/interner.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/traits/chalk/interner.rs b/crates/ra_hir_ty/src/traits/chalk/interner.rs index 15426b022..156b691b4 100644 --- a/crates/ra_hir_ty/src/traits/chalk/interner.rs +++ b/crates/ra_hir_ty/src/traits/chalk/interner.rs | |||
@@ -39,6 +39,7 @@ impl chalk_ir::interner::Interner for Interner { | |||
39 | type InternedQuantifiedWhereClauses = Vec<chalk_ir::QuantifiedWhereClause<Self>>; | 39 | type InternedQuantifiedWhereClauses = Vec<chalk_ir::QuantifiedWhereClause<Self>>; |
40 | type InternedVariableKinds = Vec<chalk_ir::VariableKind<Self>>; | 40 | type InternedVariableKinds = Vec<chalk_ir::VariableKind<Self>>; |
41 | type InternedCanonicalVarKinds = Vec<chalk_ir::CanonicalVarKind<Self>>; | 41 | type InternedCanonicalVarKinds = Vec<chalk_ir::CanonicalVarKind<Self>>; |
42 | type InternedConstraints = Vec<chalk_ir::InEnvironment<chalk_ir::Constraint<Self>>>; | ||
42 | type DefId = InternId; | 43 | type DefId = InternId; |
43 | type InternedAdtId = crate::TypeCtorId; | 44 | type InternedAdtId = crate::TypeCtorId; |
44 | type Identifier = TypeAliasId; | 45 | type Identifier = TypeAliasId; |
@@ -349,6 +350,20 @@ impl chalk_ir::interner::Interner for Interner { | |||
349 | ) -> &'a [chalk_ir::CanonicalVarKind<Self>] { | 350 | ) -> &'a [chalk_ir::CanonicalVarKind<Self>] { |
350 | &canonical_var_kinds | 351 | &canonical_var_kinds |
351 | } | 352 | } |
353 | |||
354 | fn intern_constraints<E>( | ||
355 | &self, | ||
356 | data: impl IntoIterator<Item = Result<chalk_ir::InEnvironment<chalk_ir::Constraint<Self>>, E>>, | ||
357 | ) -> Result<Self::InternedConstraints, E> { | ||
358 | data.into_iter().collect() | ||
359 | } | ||
360 | |||
361 | fn constraints_data<'a>( | ||
362 | &self, | ||
363 | constraints: &'a Self::InternedConstraints, | ||
364 | ) -> &'a [chalk_ir::InEnvironment<chalk_ir::Constraint<Self>>] { | ||
365 | constraints | ||
366 | } | ||
352 | } | 367 | } |
353 | 368 | ||
354 | impl chalk_ir::interner::HasInterner for Interner { | 369 | impl chalk_ir::interner::HasInterner for Interner { |