Skip to content

Standard macros reported as missing-unsafe #10022

Closed
@tim3z

Description

@tim3z

Hi there,

I'm using rust-analyzer (rust-analyzer 996300f4a 2021-08-23 dev) installed with the arch linux rust-analyzer package in Sublime Text 4 with the LSP package and an up to date nightly rust compiler (rustc 1.56.0-nightly (b03ccace5 2021-08-24)). Today, rust-analyzer started reporting this operation is unsafe and requires an unsafe function or block on the dbg!, eprintln! and println! (list probably not exhaustive) macros. Minimal example:

fn main() {
    dbg!(42);
}

I tried downgrading the arch package to last weeks rust-analyzer but that didn't change anything. But apparently, this has something to do with todays nightly because when using rustc 1.56.0-nightly (af140757b 2021-08-22) the issue disappears. However, running cargo check reports no issues.

I'm not quite sure if this is the right place to report this issue, but since cargo check works fine regardless of the compiler version I thought, I'd best start here. I'd be happy to provide additional information if necessary. Is there a way I can make rust-analyzer report the errors on the command line so I can exclude my editor as a potential error source?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsdiagnostics / error reportingBroken WindowBugs / technical debt to be addressed immediatelyS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions