diff options
Diffstat (limited to 'crates/hir_ty')
-rw-r--r-- | crates/hir_ty/src/infer/pat.rs | 2 | ||||
-rw-r--r-- | crates/hir_ty/src/lower.rs | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/crates/hir_ty/src/infer/pat.rs b/crates/hir_ty/src/infer/pat.rs index befa0d69b..ec491648f 100644 --- a/crates/hir_ty/src/infer/pat.rs +++ b/crates/hir_ty/src/infer/pat.rs | |||
@@ -38,7 +38,7 @@ impl<'a> InferenceContext<'a> { | |||
38 | let field_tys = def.map(|it| self.db.field_types(it)).unwrap_or_default(); | 38 | let field_tys = def.map(|it| self.db.field_types(it)).unwrap_or_default(); |
39 | let (pre, post) = match ellipsis { | 39 | let (pre, post) = match ellipsis { |
40 | Some(idx) => subpats.split_at(idx), | 40 | Some(idx) => subpats.split_at(idx), |
41 | None => (&subpats[..], &[][..]), | 41 | None => (subpats, &[][..]), |
42 | }; | 42 | }; |
43 | let post_idx_offset = field_tys.iter().count() - post.len(); | 43 | let post_idx_offset = field_tys.iter().count() - post.len(); |
44 | 44 | ||
diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs index 2bdfcd310..fd451a823 100644 --- a/crates/hir_ty/src/lower.rs +++ b/crates/hir_ty/src/lower.rs | |||
@@ -957,8 +957,7 @@ pub(crate) fn trait_environment_query( | |||
957 | let substs = Substitution::type_params(db, trait_id); | 957 | let substs = Substitution::type_params(db, trait_id); |
958 | let trait_ref = TraitRef { trait_id: to_chalk_trait_id(trait_id), substitution: substs }; | 958 | let trait_ref = TraitRef { trait_id: to_chalk_trait_id(trait_id), substitution: substs }; |
959 | let pred = WhereClause::Implemented(trait_ref); | 959 | let pred = WhereClause::Implemented(trait_ref); |
960 | let program_clause: chalk_ir::ProgramClause<Interner> = | 960 | let program_clause: chalk_ir::ProgramClause<Interner> = pred.to_chalk(db).cast(&Interner); |
961 | pred.clone().to_chalk(db).cast(&Interner); | ||
962 | clauses.push(program_clause.into_from_env_clause(&Interner)); | 961 | clauses.push(program_clause.into_from_env_clause(&Interner)); |
963 | } | 962 | } |
964 | 963 | ||