aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/traits
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-24 22:13:56 +0000
committerGitHub <[email protected]>2021-03-24 22:13:56 +0000
commit9d81618f11eb403cc0644a22f30648393ec77cf6 (patch)
treeebc9bc3b6d19b7d31e888239856dc336d729ffe3 /crates/hir_ty/src/traits
parentaac6285f0bfe60e20e042963fdda9e454e08a7ad (diff)
parentb4c20e3589372ba1536cec1bfe7de6acd2f40a4d (diff)
Merge #8190
8190: Fix chalk_ir assertion r=flodiebold a=flodiebold Fixes #8150. I implemented a validator that catches this in the tests, but it'd need to get merged in Chalk first. Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/traits')
-rw-r--r--crates/hir_ty/src/traits/chalk.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs
index 4019fdf17..011bef6f6 100644
--- a/crates/hir_ty/src/traits/chalk.rs
+++ b/crates/hir_ty/src/traits/chalk.rs
@@ -21,8 +21,8 @@ use crate::{
21 method_resolution::{TyFingerprint, ALL_FLOAT_FPS, ALL_INT_FPS}, 21 method_resolution::{TyFingerprint, ALL_FLOAT_FPS, ALL_INT_FPS},
22 to_assoc_type_id, to_chalk_trait_id, 22 to_assoc_type_id, to_chalk_trait_id,
23 utils::generics, 23 utils::generics,
24 AliasEq, AliasTy, BoundVar, CallableDefId, CallableSig, DebruijnIndex, FnDefId, ProjectionTy, 24 AliasEq, AliasTy, BoundVar, CallableDefId, DebruijnIndex, FnDefId, ProjectionTy, Substitution,
25 Substitution, TraitRef, Ty, TyKind, WhereClause, 25 TraitRef, Ty, TyKind, WhereClause,
26}; 26};
27use mapping::{ 27use mapping::{
28 convert_where_clauses, generic_predicate_to_inline_bound, make_binders, TypeAliasAsValue, 28 convert_where_clauses, generic_predicate_to_inline_bound, make_binders, TypeAliasAsValue,
@@ -288,9 +288,7 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> {
288 ) -> chalk_ir::Binders<rust_ir::FnDefInputsAndOutputDatum<Interner>> { 288 ) -> chalk_ir::Binders<rust_ir::FnDefInputsAndOutputDatum<Interner>> {
289 let sig_ty: Ty = 289 let sig_ty: Ty =
290 from_chalk(self.db, substs.at(&Interner, 0).assert_ty_ref(&Interner).clone()); 290 from_chalk(self.db, substs.at(&Interner, 0).assert_ty_ref(&Interner).clone());
291 let sig = CallableSig::from_substs( 291 let sig = &sig_ty.callable_sig(self.db).expect("first closure param should be fn ptr");
292 &sig_ty.substs().expect("first closure param should be fn ptr"),
293 );
294 let io = rust_ir::FnDefInputsAndOutputDatum { 292 let io = rust_ir::FnDefInputsAndOutputDatum {
295 argument_types: sig.params().iter().map(|ty| ty.clone().to_chalk(self.db)).collect(), 293 argument_types: sig.params().iter().map(|ty| ty.clone().to_chalk(self.db)).collect(),
296 return_type: sig.ret().clone().to_chalk(self.db), 294 return_type: sig.ret().clone().to_chalk(self.db),