You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
thread_local with const { } fails to compile in file with #![forbid(unsafe_op_in_unsafe_fn)] #121483
I expected to see this happen: Compiles without error.
Instead, this happened: Fails to build with this error:
error[E0453]: deny(unsafe_op_in_unsafe_fn) incompatible with previous forbid
--> src/lib.rs:5:1
|
1 | #![forbid(unsafe_op_in_unsafe_fn)]
| ---------------------- `forbid` level set here
...
5 | / thread_local! {
6 | | pub static FOO: Cell<u32> = const { Cell::new(1) };
7 | | }
| |_^ overruled by previous forbid
|
= note: this error originates in the macro `$crate::thread::local_impl::thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0453`.
Activity
ZeWaka commentedon Apr 12, 2024
Yeah, this isn't playing nice with the
thread_local_initializer_can_be_made_constclippy lint.Rollup merge of rust-lang#121560 - Noratrieb:stop-lint-macro-nonsense…
Unrolled build for rust-lang#121560