diff --git a/compiler/rustc_middle/src/lib.rs b/compiler/rustc_middle/src/lib.rs index b67ad8b770ea1..66d1ae1420a14 100644 --- a/compiler/rustc_middle/src/lib.rs +++ b/compiler/rustc_middle/src/lib.rs @@ -51,7 +51,6 @@ #![feature(control_flow_enum)] #![feature(associated_type_defaults)] #![feature(iter_zip)] -#![feature(thread_local_const_init)] #![feature(trusted_step)] #![feature(try_blocks)] #![feature(try_reserve_kind)] diff --git a/compiler/rustc_query_system/src/lib.rs b/compiler/rustc_query_system/src/lib.rs index b1295ba48ccb9..0da141f6836f6 100644 --- a/compiler/rustc_query_system/src/lib.rs +++ b/compiler/rustc_query_system/src/lib.rs @@ -5,7 +5,6 @@ #![feature(iter_zip)] #![feature(let_else)] #![feature(min_specialization)] -#![feature(thread_local_const_init)] #![feature(extern_types)] #[macro_use] diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index 66c01140abc17..e06379cadddd5 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -20,7 +20,6 @@ #![feature(negative_impls)] #![feature(nll)] #![feature(min_specialization)] -#![feature(thread_local_const_init)] #[macro_use] extern crate rustc_macros; diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 504c3b7e9f99c..380de97407df2 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -216,10 +216,7 @@ // std may use features in a platform-specific way #![allow(unused_features)] #![feature(rustc_allow_const_fn_unstable)] -#![cfg_attr( - test, - feature(internal_output_capture, print_internals, update_panic_count, thread_local_const_init) -)] +#![cfg_attr(test, feature(internal_output_capture, print_internals, update_panic_count))] #![cfg_attr( all(target_vendor = "fortanix", target_env = "sgx"), feature(slice_index_methods, coerce_unsized, sgx_platform) diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs index 4da59577d78a1..ed0c47bc18f13 100644 --- a/library/std/src/thread/local.rs +++ b/library/std/src/thread/local.rs @@ -164,7 +164,6 @@ macro_rules! __thread_local_inner { (@key $t:ty, const $init:expr) => {{ #[cfg_attr(not(windows), inline)] // see comments below unsafe fn __getit() -> $crate::option::Option<&'static $t> { - const _REQUIRE_UNSTABLE: () = $crate::thread::require_unstable_const_init_thread_local(); const INIT_EXPR: $t = $init; // wasm without atomics maps directly to `static mut`, and dtors diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index 343d3ef8dc538..64f6c7fa022fc 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -204,13 +204,6 @@ pub use self::local::os::Key as __OsLocalKeyInner; #[doc(hidden)] pub use self::local::statik::Key as __StaticLocalKeyInner; -// This is only used to make thread locals with `const { .. }` initialization -// expressions unstable. If and/or when that syntax is stabilized with thread -// locals this will simply be removed. -#[doc(hidden)] -#[unstable(feature = "thread_local_const_init", issue = "84223")] -pub const fn require_unstable_const_init_thread_local() {} - //////////////////////////////////////////////////////////////////////////////// // Builder //////////////////////////////////////////////////////////////////////////////// diff --git a/src/test/codegen/auxiliary/thread_local_aux.rs b/src/test/codegen/auxiliary/thread_local_aux.rs index 29b5e3ca244bf..bebaa7754dd5a 100644 --- a/src/test/codegen/auxiliary/thread_local_aux.rs +++ b/src/test/codegen/auxiliary/thread_local_aux.rs @@ -1,5 +1,4 @@ #![crate_type = "lib"] -#![feature(thread_local_const_init)] use std::cell::Cell; diff --git a/src/test/codegen/thread-local.rs b/src/test/codegen/thread-local.rs index f14368e39902d..5ac30d949fa4e 100644 --- a/src/test/codegen/thread-local.rs +++ b/src/test/codegen/thread-local.rs @@ -6,7 +6,6 @@ // ignore-android does not use #[thread_local] #![crate_type = "lib"] -#![feature(thread_local_const_init)] extern crate thread_local_aux as aux; diff --git a/src/test/ui/feature-gates/thread-local-const-init.rs b/src/test/ui/feature-gates/thread-local-const-init.rs deleted file mode 100644 index 6584ffa7cf949..0000000000000 --- a/src/test/ui/feature-gates/thread-local-const-init.rs +++ /dev/null @@ -1,4 +0,0 @@ -thread_local!(static X: u32 = const { 0 }); -//~^ ERROR: use of unstable library feature 'thread_local_const_init' - -fn main() {} diff --git a/src/test/ui/feature-gates/thread-local-const-init.stderr b/src/test/ui/feature-gates/thread-local-const-init.stderr deleted file mode 100644 index f80506831b4e8..0000000000000 --- a/src/test/ui/feature-gates/thread-local-const-init.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0658]: use of unstable library feature 'thread_local_const_init' - --> $DIR/thread-local-const-init.rs:1:1 - | -LL | thread_local!(static X: u32 = const { 0 }); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #84223 for more information - = help: add `#![feature(thread_local_const_init)]` to the crate attributes to enable - = note: this error originates in the macro `$crate::__thread_local_inner` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`.