internal: Handle fields called as method calls as the fields they resolve to

This commit is contained in:
Lukas Wirth 2023-03-04 20:33:28 +01:00
parent b85e2af898
commit 5a91f015b4
4 changed files with 63 additions and 4 deletions

View file

@ -5797,3 +5797,26 @@ mod m {
"#]],
);
}
#[test]
fn field_as_method_call_fallback() {
check(
r#"
struct S { f: u32 }
fn test() {
S { f: 0 }.f$0();
}
"#,
expect![[r#"
*f*
```rust
test::S
```
```rust
f: u32 // size = 4, align = 4, offset = 0
```
"#]],
);
}