Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/hover/tests.rs')
| -rw-r--r-- | crates/ide/src/hover/tests.rs | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/crates/ide/src/hover/tests.rs b/crates/ide/src/hover/tests.rs index 559571a1a4..a79e47dd67 100644 --- a/crates/ide/src/hover/tests.rs +++ b/crates/ide/src/hover/tests.rs @@ -1766,9 +1766,7 @@ pub fn fo$0o() {} #[test] fn test_hover_no_memory_layout() { check_hover_no_memory_layout( - r#" -struct Foo { fiel$0d_a: u8, field_b: i32, field_c: i16 } -"#, + r#"struct Foo { fiel$0d_a: u8, field_b: i32, field_c: i16 }"#, expect![[r#" *field_a* @@ -1781,6 +1779,26 @@ struct Foo { fiel$0d_a: u8, field_b: i32, field_c: i16 } ``` "#]], ); + + check_hover_no_memory_layout( + r#" +//- minicore: copy +fn main() { + let x = 2; + let y = $0|z| x + z; +} +"#, + expect![[r#" + *|* + ```rust + {closure#0} + impl Fn(i32) -> i32 + ``` + + ## Captures + * `x` by immutable borrow + "#]], + ); } #[test] |