Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-diagnostics/src/handlers/unresolved_method.rs')
-rw-r--r--crates/ide-diagnostics/src/handlers/unresolved_method.rs24
1 files changed, 23 insertions, 1 deletions
diff --git a/crates/ide-diagnostics/src/handlers/unresolved_method.rs b/crates/ide-diagnostics/src/handlers/unresolved_method.rs
index dcca85d4db..bd5d134348 100644
--- a/crates/ide-diagnostics/src/handlers/unresolved_method.rs
+++ b/crates/ide-diagnostics/src/handlers/unresolved_method.rs
@@ -268,7 +268,7 @@ impl<T, U> A<T, U> {
}
fn main() {
let a = A {a: 0, b: ""};
- A::<i32, &'static str>::foo();
+ A::<i32, &str>::foo();
}
"#,
);
@@ -351,4 +351,26 @@ fn foo() {
"#,
);
}
+
+ #[test]
+ fn iter_collect() {
+ check_diagnostics(
+ r#"
+//- minicore: unsize, coerce_unsized, iterator, iterators, sized
+struct Map<K, V>(K, V);
+impl<K, V> FromIterator<(K, V)> for Map<K, V> {
+ fn from_iter<T: IntoIterator<Item = (K, V)>>(_iter: T) -> Self {
+ loop {}
+ }
+}
+
+fn foo() -> Map<i32, &'static [&'static str]> {
+ [
+ (123, &["abc", "def"] as _),
+ (456, &["ghi"] as _),
+ ].into_iter().collect()
+}
+ "#,
+ );
+ }
}