Skip to content

&field missed inside macro #20264

@wmstack

Description

@wmstack

rust-analyzer version: rust-analyzer version: 0.3.2539-standalone (591e3b7 2025-07-13)

rustc version: rustc 1.90.0-nightly (a84ab0ce6 2025-07-06)

editor or extension: Vscode, Rust Analyzer

relevant settings: N/A

code snippet to reproduce:

struct NamedField {
    out: Vec<u8>,
}

fn main() {
    let s = NamedField { out: Vec::new() };
    str::from_utf8(s.);
}

Expectation is an &out field as follows:

Image

Inside the dbg! macro, the &out suggestion is omitted, despite being just as useful.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions