Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--crates/hir-ty/src/infer/callee.rs8
-rw-r--r--crates/hir-ty/src/tests/regression.rs12
2 files changed, 13 insertions, 7 deletions
diff --git a/crates/hir-ty/src/infer/callee.rs b/crates/hir-ty/src/infer/callee.rs
index a661731e60..e5304582ca 100644
--- a/crates/hir-ty/src/infer/callee.rs
+++ b/crates/hir-ty/src/infer/callee.rs
@@ -585,13 +585,7 @@ impl<'a, 'db> DeferredCallResolution<'db> {
method_callee.args,
);
}
- None => {
- assert!(
- ctx.lang_items.FnOnce.is_none(),
- "Expected to find a suitable `Fn`/`FnMut`/`FnOnce` implementation for `{:?}`",
- self.closure_ty
- )
- }
+ None => {}
}
}
}
diff --git a/crates/hir-ty/src/tests/regression.rs b/crates/hir-ty/src/tests/regression.rs
index c5bf521d35..2ef8999817 100644
--- a/crates/hir-ty/src/tests/regression.rs
+++ b/crates/hir-ty/src/tests/regression.rs
@@ -2935,3 +2935,15 @@ impl Foo for Bar {
"#,
);
}
+
+#[test]
+fn regression_unresolved_deferred_closure_call_resolution() {
+ check_no_mismatches(
+ r#"
+//- minicore: fn
+fn caller() {
+ let _: &[u8] = &(|| encode_fn())();
+}
+"#,
+ );
+}