Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/hover.rs')
-rw-r--r--crates/ide/src/hover.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index 3f52303d74..03b9b36775 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -483,6 +483,12 @@ fn notable_traits<'db>(
db: &'db RootDatabase,
ty: &hir::Type<'db>,
) -> Vec<(hir::Trait, Vec<(Option<hir::Type<'db>>, hir::Name)>)> {
+ if ty.is_unknown() {
+ // The trait solver returns "yes" to the question whether the error type
+ // impls any trait, and we don't want to show it as having any notable trait.
+ return Vec::new();
+ }
+
db.notable_traits_in_deps(ty.krate(db).into())
.iter()
.flat_map(|it| &**it)