Skip to content

Commit f67a70d

Browse files
committed
ide: add a new test
1 parent 0caf535 commit f67a70d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/tools/rust-analyzer/crates/ide/src/references.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,27 @@ fn test() {
350350
);
351351
}
352352

353+
#[test]
354+
fn test_access() {
355+
check(
356+
r#"
357+
struct S { f$0: u32 }
358+
359+
#[test]
360+
fn test() {
361+
let mut x = S { f: 92 };
362+
x.f = 92;
363+
}
364+
"#,
365+
expect![[r#"
366+
f Field FileId(0) 11..17 11..12
367+
368+
FileId(0) 61..62 read test
369+
FileId(0) 76..77 write test
370+
"#]],
371+
);
372+
}
373+
353374
#[test]
354375
fn test_struct_literal_after_space() {
355376
check(

0 commit comments

Comments
 (0)