diff options
author | Florian Diebold <[email protected]> | 2021-03-24 22:07:54 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-03-24 22:10:13 +0000 |
commit | b4c20e3589372ba1536cec1bfe7de6acd2f40a4d (patch) | |
tree | 18a40f362334376c31afbc41cdd8a304f6b6d23d /crates/hir_ty/src/traits/chalk.rs | |
parent | 4a1f5d367db3b5c6ec27d96c96c98b89988c0b3a (diff) |
Fix chalk_ir assertion
Fixes #8150.
Diffstat (limited to 'crates/hir_ty/src/traits/chalk.rs')
-rw-r--r-- | crates/hir_ty/src/traits/chalk.rs | 8 |
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 | }; |
27 | use mapping::{ | 27 | use 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), |