Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-diagnostics/src/handlers/unimplemented_trait.rs')
-rw-r--r--crates/ide-diagnostics/src/handlers/unimplemented_trait.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/ide-diagnostics/src/handlers/unimplemented_trait.rs b/crates/ide-diagnostics/src/handlers/unimplemented_trait.rs
index d94ceef642..4a253bc831 100644
--- a/crates/ide-diagnostics/src/handlers/unimplemented_trait.rs
+++ b/crates/ide-diagnostics/src/handlers/unimplemented_trait.rs
@@ -69,4 +69,20 @@ fn foo() {
"#,
);
}
+
+ #[test]
+ fn for_iterable() {
+ check_diagnostics(
+ r#"
+//- minicore: iterator
+fn foo() {
+ for _ in () {}
+ // ^^ error: the trait bound `(): Iterator` is not satisfied
+ // ^^ error: the trait bound `(): Iterator` is not satisfied
+ // | required by the bound `(): IntoIterator`
+}
+
+ "#,
+ );
+ }
}