diff options
Diffstat (limited to 'crates/hir_ty/src/traits')
-rw-r--r-- | crates/hir_ty/src/traits/chalk.rs | 2 | ||||
-rw-r--r-- | crates/hir_ty/src/traits/chalk/interner.rs | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs index 232cf9cd0..4bd8ba303 100644 --- a/crates/hir_ty/src/traits/chalk.rs +++ b/crates/hir_ty/src/traits/chalk.rs | |||
@@ -429,7 +429,7 @@ pub(crate) fn trait_datum_query( | |||
429 | let generic_params = generics(db.upcast(), trait_.into()); | 429 | let generic_params = generics(db.upcast(), trait_.into()); |
430 | let bound_vars = Substs::bound_vars(&generic_params, DebruijnIndex::INNERMOST); | 430 | let bound_vars = Substs::bound_vars(&generic_params, DebruijnIndex::INNERMOST); |
431 | let flags = rust_ir::TraitFlags { | 431 | let flags = rust_ir::TraitFlags { |
432 | auto: trait_data.auto, | 432 | auto: trait_data.is_auto, |
433 | upstream: trait_.lookup(db.upcast()).container.krate() != krate, | 433 | upstream: trait_.lookup(db.upcast()).container.krate() != krate, |
434 | non_enumerable: true, | 434 | non_enumerable: true, |
435 | coinductive: false, // only relevant for Chalk testing | 435 | coinductive: false, // only relevant for Chalk testing |
diff --git a/crates/hir_ty/src/traits/chalk/interner.rs b/crates/hir_ty/src/traits/chalk/interner.rs index 1dc3f497d..94e94a26d 100644 --- a/crates/hir_ty/src/traits/chalk/interner.rs +++ b/crates/hir_ty/src/traits/chalk/interner.rs | |||
@@ -5,6 +5,7 @@ use super::tls; | |||
5 | use base_db::salsa::InternId; | 5 | use base_db::salsa::InternId; |
6 | use chalk_ir::{GenericArg, Goal, GoalData}; | 6 | use chalk_ir::{GenericArg, Goal, GoalData}; |
7 | use hir_def::TypeAliasId; | 7 | use hir_def::TypeAliasId; |
8 | use smallvec::SmallVec; | ||
8 | use std::{fmt, sync::Arc}; | 9 | use std::{fmt, sync::Arc}; |
9 | 10 | ||
10 | #[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] | 11 | #[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] |
@@ -33,7 +34,7 @@ impl chalk_ir::interner::Interner for Interner { | |||
33 | type InternedGenericArg = chalk_ir::GenericArgData<Self>; | 34 | type InternedGenericArg = chalk_ir::GenericArgData<Self>; |
34 | type InternedGoal = Arc<GoalData<Self>>; | 35 | type InternedGoal = Arc<GoalData<Self>>; |
35 | type InternedGoals = Vec<Goal<Self>>; | 36 | type InternedGoals = Vec<Goal<Self>>; |
36 | type InternedSubstitution = Vec<GenericArg<Self>>; | 37 | type InternedSubstitution = SmallVec<[GenericArg<Self>; 2]>; |
37 | type InternedProgramClause = Arc<chalk_ir::ProgramClauseData<Self>>; | 38 | type InternedProgramClause = Arc<chalk_ir::ProgramClauseData<Self>>; |
38 | type InternedProgramClauses = Arc<[chalk_ir::ProgramClause<Self>]>; | 39 | type InternedProgramClauses = Arc<[chalk_ir::ProgramClause<Self>]>; |
39 | type InternedQuantifiedWhereClauses = Vec<chalk_ir::QuantifiedWhereClause<Self>>; | 40 | type InternedQuantifiedWhereClauses = Vec<chalk_ir::QuantifiedWhereClause<Self>>; |
@@ -265,13 +266,13 @@ impl chalk_ir::interner::Interner for Interner { | |||
265 | fn intern_substitution<E>( | 266 | fn intern_substitution<E>( |
266 | &self, | 267 | &self, |
267 | data: impl IntoIterator<Item = Result<GenericArg<Self>, E>>, | 268 | data: impl IntoIterator<Item = Result<GenericArg<Self>, E>>, |
268 | ) -> Result<Vec<GenericArg<Self>>, E> { | 269 | ) -> Result<Self::InternedSubstitution, E> { |
269 | data.into_iter().collect() | 270 | data.into_iter().collect() |
270 | } | 271 | } |
271 | 272 | ||
272 | fn substitution_data<'a>( | 273 | fn substitution_data<'a>( |
273 | &self, | 274 | &self, |
274 | substitution: &'a Vec<GenericArg<Self>>, | 275 | substitution: &'a Self::InternedSubstitution, |
275 | ) -> &'a [GenericArg<Self>] { | 276 | ) -> &'a [GenericArg<Self>] { |
276 | substitution | 277 | substitution |
277 | } | 278 | } |