Can't allow unsafe_attr_outside_unsafe
in Rust 2015-2021
#140602
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
D-edition
Diagnostics: An error or lint that should account for edition differences.
L-unsafe_attr_outside_unsafe
Lint: unsafe_attr_outside_unsafe
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code in Rust 2021 (playground):
I expected to see this happen: compiles successfully
Instead, this happened:
Meta
rustc --version --verbose
:Reproduces in
1.88.0-nightly (2025-05-01 3350c1eb3fd8fe1bee1e)
on the Playground.The text was updated successfully, but these errors were encountered: