Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs')
-rw-r--r--crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs b/crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs
index 0e18ce9674..2c05544701 100644
--- a/crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs
+++ b/crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs
@@ -156,4 +156,22 @@ impl Trait for dyn OtherTrait {}
"#,
)
}
+
+ #[test]
+ fn no_false_positive_on_specialization() {
+ check_diagnostics(
+ r#"
+#![feature(specialization)]
+
+pub trait Foo {
+ fn foo();
+}
+
+impl<T> Foo for T {
+ default fn foo() {}
+}
+impl Foo for bool {}
+"#,
+ );
+ }
}