thread_local
with const { }
fails to compile in file with #![forbid(unsafe_op_in_unsafe_fn)]
#121483
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
L-unsafe_op_in_unsafe_fn
Lint: unsafe_op_in_unsafe_fn
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.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
I expected to see this happen: Compiles without error.
Instead, this happened: Fails to build with this error:
It seems https://github.com/rust-lang/rust/blob/master/library/std/src/sys/pal/common/thread_local/os_local.rs is using
#[deny(unsafe_op_in_unsafe_fn)]
. But the existence offorbid
makes somewhat problematic in a macro.Meta
Occurs on
rustc 1.76.0 (07dca489a 2024-02-04)
andrustc 1.78.0-nightly (3406ada96 2024-02-21)
.The text was updated successfully, but these errors were encountered: