Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
skycloudd opened this issue Aug 27, 2024 · 0 comments · Fixed by #18003
Closed

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

skycloudd opened this issue Aug 27, 2024 · 0 comments · Fixed by #18003
Labels
A-diagnostics diagnostics / error reporting C-bug Category: bug

Comments

@skycloudd
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics diagnostics / error reporting C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants