Skip to content

Missing unsafe block error where rustc doesn't give an error #17978

@skycloudd

Description

@skycloudd

rust-analyzer version: rust-analyzer 0.4.2088-standalone (0f7f68dad 2024-08-27)

rustc version: rustc 1.82.0-nightly (515395af0 2024-08-26)

editor or extension: VSCode, extension version v0.4.2088 (pre-release)

relevant settings: N/A (i think?)

repository link (if public, optional): N/A

code snippet to reproduce:

fn main() {
    static mut STACK: () = ();

    let _ = std::ptr::addr_of!(STACK);
}

On stable (1.80.1) this code does error in both rustc and rust-analyzer, but on nightly it only errors in rust-analyzer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsdiagnostics / error reportingC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions