Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/autoderef.rs')
-rw-r--r--crates/hir-ty/src/autoderef.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/hir-ty/src/autoderef.rs b/crates/hir-ty/src/autoderef.rs
index 26ca7fb9a1..4ea0156e12 100644
--- a/crates/hir-ty/src/autoderef.rs
+++ b/crates/hir-ty/src/autoderef.rs
@@ -225,7 +225,9 @@ pub(crate) fn deref_by_trait(
// Check that the type implements Deref at all
let trait_ref = projection.trait_ref(db);
let implements_goal: Goal = trait_ref.cast(Interner);
- table.try_obligation(implements_goal.clone())?;
+ if table.try_obligation(implements_goal.clone()).no_solution() {
+ return None;
+ }
table.register_obligation(implements_goal);