Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-diagnostics/src/handlers/incorrect_generics_len.rs')
| -rw-r--r-- | crates/ide-diagnostics/src/handlers/incorrect_generics_len.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/crates/ide-diagnostics/src/handlers/incorrect_generics_len.rs b/crates/ide-diagnostics/src/handlers/incorrect_generics_len.rs index cc4bcd02b8..8244f303d9 100644 --- a/crates/ide-diagnostics/src/handlers/incorrect_generics_len.rs +++ b/crates/ide-diagnostics/src/handlers/incorrect_generics_len.rs @@ -74,17 +74,19 @@ fn foo() { check_diagnostics( r#" struct Foo<'a, 'b>(&'a &'b ()); -struct Bar<'a>(&'a ()); -fn foo() -> Foo { - let _ = Foo; - let _ = Foo::<>; - let _ = Foo::<'static>; - // ^^^^^^^^^^^ error: this struct takes 2 lifetime arguments but 1 lifetime argument was supplied +fn foo(Foo(_): Foo) -> Foo { + let _: Foo = Foo(&&()); + let _: Foo::<> = Foo::<>(&&()); + let _: Foo::<'static> + // ^^^^^^^^^^^ error: this struct takes 2 lifetime arguments but 1 lifetime argument was supplied + = Foo::<'static>(&&()); + // ^^^^^^^^^^^ error: this struct takes 2 lifetime arguments but 1 lifetime argument was supplied + |_: Foo| -> Foo {loop{}}; + loop {} } -fn bar(_v: Bar) -> Foo { loop {} } "#, ); } |