mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
internal: Handle fields called as method calls as the fields they resolve to
This commit is contained in:
parent
b85e2af898
commit
5a91f015b4
4 changed files with 63 additions and 4 deletions
|
@ -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
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue