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.rs29
1 files changed, 29 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 fa7ba90a75..0e18ce9674 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
@@ -127,4 +127,33 @@ impl !Trait for () {}
"#,
)
}
+
+ #[test]
+ fn impl_sized_for_unsized() {
+ check_diagnostics(
+ r#"
+//- minicore: sized
+trait Trait {
+ type Item
+ where
+ Self: Sized;
+
+ fn item()
+ where
+ Self: Sized;
+}
+
+trait OtherTrait {}
+
+impl Trait for () {
+ type Item = ();
+ fn item() {}
+}
+
+// Items with Self: Sized bound not required to be implemented for unsized types.
+impl Trait for str {}
+impl Trait for dyn OtherTrait {}
+ "#,
+ )
+ }
}