From 6c5f53e65ee5f022611033dbf58c42e26be7f93d Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Sun, 26 Nov 2017 23:19:18 +0100 Subject: [PATCH] Stabilize const-calling existing const-fns in std Fixes #46038 --- src/libcore/cell.rs | 3 -- src/libcore/lib.rs | 34 ------------------- src/libcore/mem.rs | 2 -- src/libcore/nonzero.rs | 1 - src/libcore/num/mod.rs | 4 --- src/libcore/ptr.rs | 4 --- src/libcore/sync/atomic.rs | 15 +------- src/libcore/tests/lib.rs | 4 --- src/librustc/lib.rs | 1 - src/librustc_apfloat/lib.rs | 2 -- src/librustc_const_eval/lib.rs | 2 -- src/librustc_const_math/lib.rs | 3 -- src/librustc_mir/diagnostics.rs | 4 --- src/librustc_trans/lib.rs | 3 -- src/libstd/lib.rs | 11 ------ src/libstd/sync/once.rs | 1 - .../dropck_tarena_cycle_checked.rs | 1 - .../compile-fail/const-fn-feature-flags.rs | 24 ------------- .../dropck_trait_cycle_checked.rs | 2 -- .../compile-fail/issue-17718-const-borrow.rs | 2 -- src/test/compile-fail/issue-43733-2.rs | 2 +- src/test/compile-fail/issue-7364.rs | 2 +- src/test/debuginfo/constant-debug-locs.rs | 1 - .../vector-sort-panic-safe.rs | 1 - .../run-pass-valgrind/cast-enum-with-dtor.rs | 1 - ...ject-from-type-param-via-bound-in-where.rs | 2 -- .../run-pass/auxiliary/issue-17718-aux.rs | 2 -- .../auxiliary/thread-local-extern-static.rs | 1 - src/test/run-pass/box-of-array-of-drop-1.rs | 2 -- src/test/run-pass/box-of-array-of-drop-2.rs | 2 -- src/test/run-pass/const-fn-feature-flags.rs | 4 +-- src/test/run-pass/const-size_of-align_of.rs | 2 +- .../issue-17718-static-unsafe-interior.rs | 3 -- src/test/run-pass/issue-17718.rs | 4 --- src/test/run-pass/issue-21486.rs | 2 -- src/test/run-pass/issue-26655.rs | 2 -- src/test/run-pass/issue-27997.rs | 2 -- src/test/run-pass/nested-vec-3.rs | 2 -- src/test/run-pass/panic-handler-chain.rs | 1 - src/test/run-pass/panic-handler-set-twice.rs | 1 - src/test/run-pass/struct-order-of-eval-3.rs | 2 -- src/test/run-pass/struct-order-of-eval-4.rs | 2 -- src/test/ui/span/dropck_arr_cycle_checked.rs | 2 +- src/test/ui/span/dropck_vec_cycle_checked.rs | 2 +- .../vec-must-not-hide-type-from-dropck.rs | 2 +- 45 files changed, 8 insertions(+), 164 deletions(-) delete mode 100644 src/test/compile-fail/const-fn-feature-flags.rs diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index d02576ae54607..d4cd3f6264efc 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -329,7 +329,6 @@ impl Cell { /// let c = Cell::new(5); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_cell_new")] #[inline] pub const fn new(value: T) -> Cell { Cell { @@ -544,7 +543,6 @@ impl RefCell { /// let c = RefCell::new(5); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_refcell_new")] #[inline] pub const fn new(value: T) -> RefCell { RefCell { @@ -1215,7 +1213,6 @@ impl UnsafeCell { /// let uc = UnsafeCell::new(5); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_unsafe_cell_new")] #[inline] pub const fn new(value: T) -> UnsafeCell { UnsafeCell { value: value } diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 631b9f98589f6..07b45ad6a50f6 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -85,47 +85,13 @@ #![feature(prelude_import)] #![feature(repr_simd, platform_intrinsics)] #![feature(rustc_attrs)] -#![feature(rustc_const_unstable)] #![feature(specialization)] #![feature(staged_api)] #![feature(unboxed_closures)] #![feature(untagged_unions)] #![feature(unwind_attributes)] -#![feature(const_min_value)] -#![feature(const_max_value)] -#![feature(const_atomic_bool_new)] -#![feature(const_atomic_isize_new)] -#![feature(const_atomic_usize_new)] -#![feature(const_atomic_i8_new)] -#![feature(const_atomic_u8_new)] -#![feature(const_atomic_i16_new)] -#![feature(const_atomic_u16_new)] -#![feature(const_atomic_i32_new)] -#![feature(const_atomic_u32_new)] -#![feature(const_atomic_i64_new)] -#![feature(const_atomic_u64_new)] -#![feature(const_unsafe_cell_new)] -#![feature(const_cell_new)] -#![feature(const_nonzero_new)] #![cfg_attr(not(stage0), feature(doc_spotlight))] -#![cfg_attr(not(stage0), feature(const_min_value))] -#![cfg_attr(not(stage0), feature(const_max_value))] -#![cfg_attr(not(stage0), feature(const_atomic_bool_new))] -#![cfg_attr(not(stage0), feature(const_atomic_isize_new))] -#![cfg_attr(not(stage0), feature(const_atomic_usize_new))] -#![cfg_attr(not(stage0), feature(const_atomic_i8_new))] -#![cfg_attr(not(stage0), feature(const_atomic_u8_new))] -#![cfg_attr(not(stage0), feature(const_atomic_i16_new))] -#![cfg_attr(not(stage0), feature(const_atomic_u16_new))] -#![cfg_attr(not(stage0), feature(const_atomic_i32_new))] -#![cfg_attr(not(stage0), feature(const_atomic_u32_new))] -#![cfg_attr(not(stage0), feature(const_atomic_i64_new))] -#![cfg_attr(not(stage0), feature(const_atomic_u64_new))] -#![cfg_attr(not(stage0), feature(const_unsafe_cell_new))] -#![cfg_attr(not(stage0), feature(const_cell_new))] -#![cfg_attr(not(stage0), feature(const_nonzero_new))] - #[prelude_import] #[allow(unused)] use prelude::v1::*; diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index d57fbdf55f80e..5b1a9399c39bf 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -311,7 +311,6 @@ pub fn forget(t: T) { /// [alignment]: ./fn.align_of.html #[inline] #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_const_unstable(feature = "const_size_of")] pub const fn size_of() -> usize { unsafe { intrinsics::size_of::() } } @@ -403,7 +402,6 @@ pub fn min_align_of_val(val: &T) -> usize { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_const_unstable(feature = "const_align_of")] pub const fn align_of() -> usize { unsafe { intrinsics::min_align_of::() } } diff --git a/src/libcore/nonzero.rs b/src/libcore/nonzero.rs index edc0104f46b5c..a943adb7540ac 100644 --- a/src/libcore/nonzero.rs +++ b/src/libcore/nonzero.rs @@ -71,7 +71,6 @@ impl NonZero { #[unstable(feature = "nonzero", reason = "needs an RFC to flesh out the design", issue = "27730")] - #[rustc_const_unstable(feature = "const_nonzero_new")] #[inline] pub const unsafe fn new_unchecked(inner: T) -> Self { NonZero(inner) diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 1230066e2b33b..bfa00f895c0b1 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -110,7 +110,6 @@ macro_rules! int_impl { /// assert_eq!(i8::min_value(), -128); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_min_value")] #[inline] pub const fn min_value() -> Self { !0 ^ ((!0 as $UnsignedT) >> 1) as Self @@ -124,7 +123,6 @@ macro_rules! int_impl { /// assert_eq!(i8::max_value(), 127); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_max_value")] #[inline] pub const fn max_value() -> Self { !Self::min_value() @@ -1283,7 +1281,6 @@ macro_rules! uint_impl { /// assert_eq!(u8::min_value(), 0); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_min_value")] #[inline] pub const fn min_value() -> Self { 0 } @@ -1295,7 +1292,6 @@ macro_rules! uint_impl { /// assert_eq!(u8::max_value(), 255); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_max_value")] #[inline] pub const fn max_value() -> Self { !0 } diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 126558e3025d5..0c2fcd082ef8e 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -74,7 +74,6 @@ pub unsafe fn drop_in_place(to_drop: *mut T) { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_const_unstable(feature = "const_ptr_null")] pub const fn null() -> *const T { 0 as *const T } /// Creates a null mutable raw pointer. @@ -89,7 +88,6 @@ pub const fn null() -> *const T { 0 as *const T } /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_const_unstable(feature = "const_ptr_null_mut")] pub const fn null_mut() -> *mut T { 0 as *mut T } /// Swaps the values at two mutable locations of the same type, without @@ -2339,7 +2337,6 @@ impl Unique { /// /// `ptr` must be non-null. #[unstable(feature = "unique", issue = "27730")] - #[rustc_const_unstable(feature = "const_unique_new")] pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { Unique { pointer: NonZero::new_unchecked(ptr), _marker: PhantomData } } @@ -2474,7 +2471,6 @@ impl Shared { /// /// `ptr` must be non-null. #[unstable(feature = "shared", issue = "27730")] - #[rustc_const_unstable(feature = "const_shared_new")] pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { Shared { pointer: NonZero::new_unchecked(ptr), _marker: PhantomData } } diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index b7cf6d778a2f9..2cabadebfb7f5 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -243,7 +243,6 @@ impl AtomicBool { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_atomic_bool_new")] pub const fn new(v: bool) -> AtomicBool { AtomicBool { v: UnsafeCell::new(v as u8) } } @@ -657,7 +656,6 @@ impl AtomicPtr { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_atomic_ptr_new")] pub const fn new(p: *mut T) -> AtomicPtr { AtomicPtr { p: UnsafeCell::new(p) } } @@ -936,7 +934,7 @@ impl From<*mut T> for AtomicPtr { #[cfg(target_has_atomic = "ptr")] macro_rules! atomic_int { - ($stable:meta, $const_unstable:meta, + ($stable:meta, $stable_cxchg:meta, $stable_debug:meta, $stable_access:meta, @@ -1005,7 +1003,6 @@ macro_rules! atomic_int { /// ``` #[inline] #[$stable] - #[$const_unstable] pub const fn new(v: $int_type) -> Self { $atomic_type {v: UnsafeCell::new(v)} } @@ -1369,7 +1366,6 @@ macro_rules! atomic_int { #[cfg(target_has_atomic = "8")] atomic_int! { unstable(feature = "integer_atomics", issue = "32976"), - rustc_const_unstable(feature = "const_atomic_i8_new"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), @@ -1379,7 +1375,6 @@ atomic_int! { #[cfg(target_has_atomic = "8")] atomic_int! { unstable(feature = "integer_atomics", issue = "32976"), - rustc_const_unstable(feature = "const_atomic_u8_new"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), @@ -1389,7 +1384,6 @@ atomic_int! { #[cfg(target_has_atomic = "16")] atomic_int! { unstable(feature = "integer_atomics", issue = "32976"), - rustc_const_unstable(feature = "const_atomic_i16_new"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), @@ -1399,7 +1393,6 @@ atomic_int! { #[cfg(target_has_atomic = "16")] atomic_int! { unstable(feature = "integer_atomics", issue = "32976"), - rustc_const_unstable(feature = "const_atomic_u16_new"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), @@ -1409,7 +1402,6 @@ atomic_int! { #[cfg(target_has_atomic = "32")] atomic_int! { unstable(feature = "integer_atomics", issue = "32976"), - rustc_const_unstable(feature = "const_atomic_i32_new"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), @@ -1419,7 +1411,6 @@ atomic_int! { #[cfg(target_has_atomic = "32")] atomic_int! { unstable(feature = "integer_atomics", issue = "32976"), - rustc_const_unstable(feature = "const_atomic_u32_new"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), @@ -1429,7 +1420,6 @@ atomic_int! { #[cfg(target_has_atomic = "64")] atomic_int! { unstable(feature = "integer_atomics", issue = "32976"), - rustc_const_unstable(feature = "const_atomic_i64_new"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), @@ -1439,7 +1429,6 @@ atomic_int! { #[cfg(target_has_atomic = "64")] atomic_int! { unstable(feature = "integer_atomics", issue = "32976"), - rustc_const_unstable(feature = "const_atomic_u64_new"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), unstable(feature = "integer_atomics", issue = "32976"), @@ -1449,7 +1438,6 @@ atomic_int! { #[cfg(target_has_atomic = "ptr")] atomic_int!{ stable(feature = "rust1", since = "1.0.0"), - rustc_const_unstable(feature = "const_atomic_isize_new"), stable(feature = "extended_compare_and_swap", since = "1.10.0"), stable(feature = "atomic_debug", since = "1.3.0"), stable(feature = "atomic_access", since = "1.15.0"), @@ -1459,7 +1447,6 @@ atomic_int!{ #[cfg(target_has_atomic = "ptr")] atomic_int!{ stable(feature = "rust1", since = "1.0.0"), - rustc_const_unstable(feature = "const_atomic_usize_new"), stable(feature = "extended_compare_and_swap", since = "1.10.0"), stable(feature = "atomic_debug", since = "1.3.0"), stable(feature = "atomic_access", since = "1.15.0"), diff --git a/src/libcore/tests/lib.rs b/src/libcore/tests/lib.rs index e2283a71a0a8f..0e445cdac358a 100644 --- a/src/libcore/tests/lib.rs +++ b/src/libcore/tests/lib.rs @@ -42,10 +42,6 @@ #![feature(try_trait)] #![feature(unique)] -#![feature(const_atomic_bool_new)] -#![feature(const_atomic_usize_new)] -#![feature(const_atomic_isize_new)] - extern crate core; extern crate test; diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index b59f7480476b8..a8c80aaa0309e 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -64,7 +64,6 @@ #![feature(underscore_lifetimes)] #![feature(trace_macros)] #![feature(test)] -#![feature(const_atomic_bool_new)] #![recursion_limit="512"] diff --git a/src/librustc_apfloat/lib.rs b/src/librustc_apfloat/lib.rs index 09c9cecdceee6..7dea3dae0bcd1 100644 --- a/src/librustc_apfloat/lib.rs +++ b/src/librustc_apfloat/lib.rs @@ -45,8 +45,6 @@ #![deny(warnings)] #![forbid(unsafe_code)] -#![feature(const_max_value)] -#![feature(const_min_value)] #![feature(i128_type)] #![feature(slice_patterns)] #![feature(try_from)] diff --git a/src/librustc_const_eval/lib.rs b/src/librustc_const_eval/lib.rs index 714cead4befda..5e569e21de7b7 100644 --- a/src/librustc_const_eval/lib.rs +++ b/src/librustc_const_eval/lib.rs @@ -25,8 +25,6 @@ #![feature(box_syntax)] #![feature(i128_type)] -#![feature(const_min_value)] - extern crate arena; #[macro_use] extern crate syntax; #[macro_use] extern crate log; diff --git a/src/librustc_const_math/lib.rs b/src/librustc_const_math/lib.rs index c6893acb31f2e..095b8bb50dc6c 100644 --- a/src/librustc_const_math/lib.rs +++ b/src/librustc_const_math/lib.rs @@ -22,9 +22,6 @@ #![feature(i128)] #![feature(i128_type)] -#![feature(const_min_value)] -#![feature(const_max_value)] - extern crate rustc_apfloat; extern crate syntax; diff --git a/src/librustc_mir/diagnostics.rs b/src/librustc_mir/diagnostics.rs index 0f67f7bf6deb4..619c0dc847ebc 100644 --- a/src/librustc_mir/diagnostics.rs +++ b/src/librustc_mir/diagnostics.rs @@ -770,8 +770,6 @@ static B: &'static AtomicUsize = &A; // ok! You can also have this error while using a cell type: ```compile_fail,E0492 -#![feature(const_cell_new)] - use std::cell::Cell; const A: Cell = Cell::new(1); @@ -798,8 +796,6 @@ However, if you still wish to use these types, you can achieve this by an unsafe wrapper: ``` -#![feature(const_cell_new)] - use std::cell::Cell; use std::marker::Sync; diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 923d93587e9c1..3d1bd81fe21a3 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -33,9 +33,6 @@ #![feature(slice_patterns)] #![feature(conservative_impl_trait)] -#![feature(const_atomic_bool_new)] -#![feature(const_once_new)] - use rustc::dep_graph::WorkProduct; use syntax_pos::symbol::Symbol; diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 9587bb424bd4e..bf177ac7f2c23 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -256,15 +256,6 @@ #![feature(collections_range)] #![feature(compiler_builtins_lib)] #![feature(const_fn)] -#![feature(const_max_value)] -#![feature(const_atomic_bool_new)] -#![feature(const_atomic_isize_new)] -#![feature(const_atomic_usize_new)] -#![feature(const_unsafe_cell_new)] -#![feature(const_cell_new)] -#![feature(const_once_new)] -#![feature(const_ptr_null)] -#![feature(const_ptr_null_mut)] #![feature(core_float)] #![feature(core_intrinsics)] #![feature(dropck_eyepatch)] @@ -306,7 +297,6 @@ #![feature(repr_align)] #![feature(repr_simd)] #![feature(rustc_attrs)] -#![feature(rustc_const_unstable)] #![feature(shared)] #![feature(sip_hash_13)] #![feature(slice_bytes)] @@ -331,7 +321,6 @@ #![feature(doc_masked)] #![feature(doc_spotlight)] #![cfg_attr(test, feature(update_panic_count))] -#![cfg_attr(windows, feature(const_atomic_ptr_new))] #![cfg_attr(windows, feature(used))] #![default_lib_allocator] diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index 2ef99525af5fd..6fd8b6a5bbae4 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -156,7 +156,6 @@ struct Finish { impl Once { /// Creates a new `Once` value. #[stable(feature = "once_new", since = "1.2.0")] - #[rustc_const_unstable(feature = "const_once_new")] pub const fn new() -> Once { Once { state: AtomicUsize::new(INCOMPLETE), diff --git a/src/test/compile-fail-fulldeps/dropck_tarena_cycle_checked.rs b/src/test/compile-fail-fulldeps/dropck_tarena_cycle_checked.rs index fa85432fb8e3f..bc88ff9244c99 100644 --- a/src/test/compile-fail-fulldeps/dropck_tarena_cycle_checked.rs +++ b/src/test/compile-fail-fulldeps/dropck_tarena_cycle_checked.rs @@ -17,7 +17,6 @@ // for the error message we see here.) #![feature(rustc_private)] -#![feature(const_atomic_usize_new)] extern crate arena; diff --git a/src/test/compile-fail/const-fn-feature-flags.rs b/src/test/compile-fail/const-fn-feature-flags.rs deleted file mode 100644 index 823cb89b365ca..0000000000000 --- a/src/test/compile-fail/const-fn-feature-flags.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test use of const fns in std using individual feature gates. - -use std::cell::Cell; - -const CELL: Cell = Cell::new(42); //~ERROR not yet stable as a const fn - //~^HELP #![feature(const_cell_new)] - -fn main() { - let v = CELL.get(); - CELL.set(v+1); - - assert_eq!(CELL.get(), v); -} - diff --git a/src/test/compile-fail/dropck_trait_cycle_checked.rs b/src/test/compile-fail/dropck_trait_cycle_checked.rs index c0f0e3650d9fb..b6b7fa1a233d7 100644 --- a/src/test/compile-fail/dropck_trait_cycle_checked.rs +++ b/src/test/compile-fail/dropck_trait_cycle_checked.rs @@ -13,8 +13,6 @@ // // (Compare against compile-fail/dropck_vec_cycle_checked.rs) -#![feature(const_atomic_usize_new)] - use std::cell::Cell; use id::Id; diff --git a/src/test/compile-fail/issue-17718-const-borrow.rs b/src/test/compile-fail/issue-17718-const-borrow.rs index 1464fcd9a1cd9..07123c6949255 100644 --- a/src/test/compile-fail/issue-17718-const-borrow.rs +++ b/src/test/compile-fail/issue-17718-const-borrow.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_unsafe_cell_new)] - use std::cell::UnsafeCell; const A: UnsafeCell = UnsafeCell::new(1); diff --git a/src/test/compile-fail/issue-43733-2.rs b/src/test/compile-fail/issue-43733-2.rs index 1bf165c89d329..0fd31454596e6 100644 --- a/src/test/compile-fail/issue-43733-2.rs +++ b/src/test/compile-fail/issue-43733-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_fn, const_cell_new, const_unsafe_cell_new)] +#![feature(const_fn)] #![feature(cfg_target_thread_local, thread_local_internals)] // On platforms *without* `#[thread_local]`, use diff --git a/src/test/compile-fail/issue-7364.rs b/src/test/compile-fail/issue-7364.rs index ef53be7578005..3979790e3d4c7 100644 --- a/src/test/compile-fail/issue-7364.rs +++ b/src/test/compile-fail/issue-7364.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(box_syntax, const_refcell_new)] +#![feature(box_syntax)] use std::cell::RefCell; diff --git a/src/test/debuginfo/constant-debug-locs.rs b/src/test/debuginfo/constant-debug-locs.rs index 7a24510b7d409..8fc910d8a6daa 100644 --- a/src/test/debuginfo/constant-debug-locs.rs +++ b/src/test/debuginfo/constant-debug-locs.rs @@ -15,7 +15,6 @@ #![allow(dead_code, unused_variables)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] -#![feature(const_unsafe_cell_new)] #![feature(static_mutex)] // This test makes sure that the compiler doesn't crash when trying to assign diff --git a/src/test/run-pass-fulldeps/vector-sort-panic-safe.rs b/src/test/run-pass-fulldeps/vector-sort-panic-safe.rs index 82305045f801f..adc72aa0ea23b 100644 --- a/src/test/run-pass-fulldeps/vector-sort-panic-safe.rs +++ b/src/test/run-pass-fulldeps/vector-sort-panic-safe.rs @@ -12,7 +12,6 @@ #![feature(rustc_private)] #![feature(sort_unstable)] -#![feature(const_atomic_usize_new)] extern crate rand; diff --git a/src/test/run-pass-valgrind/cast-enum-with-dtor.rs b/src/test/run-pass-valgrind/cast-enum-with-dtor.rs index 439c1080f4731..4466a95cb39b9 100644 --- a/src/test/run-pass-valgrind/cast-enum-with-dtor.rs +++ b/src/test/run-pass-valgrind/cast-enum-with-dtor.rs @@ -11,7 +11,6 @@ // no-prefer-dynamic #![allow(dead_code)] -#![feature(const_atomic_usize_new)] // check dtor calling order when casting enums. diff --git a/src/test/run-pass/associated-types-project-from-type-param-via-bound-in-where.rs b/src/test/run-pass/associated-types-project-from-type-param-via-bound-in-where.rs index 7cde780cc54ba..5ceb1013ad811 100644 --- a/src/test/run-pass/associated-types-project-from-type-param-via-bound-in-where.rs +++ b/src/test/run-pass/associated-types-project-from-type-param-via-bound-in-where.rs @@ -12,8 +12,6 @@ // `Item` originates in a where-clause, not the declaration of // `T`. Issue #20300. -#![feature(const_atomic_usize_new)] - use std::marker::{PhantomData}; use std::sync::atomic::{AtomicUsize}; use std::sync::atomic::Ordering::SeqCst; diff --git a/src/test/run-pass/auxiliary/issue-17718-aux.rs b/src/test/run-pass/auxiliary/issue-17718-aux.rs index 36891a1ecadb8..2bc8b4b7ba032 100644 --- a/src/test/run-pass/auxiliary/issue-17718-aux.rs +++ b/src/test/run-pass/auxiliary/issue-17718-aux.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_atomic_usize_new)] - use std::sync::atomic; pub const C1: usize = 1; diff --git a/src/test/run-pass/auxiliary/thread-local-extern-static.rs b/src/test/run-pass/auxiliary/thread-local-extern-static.rs index bce87ef5a2668..e9457886be80d 100644 --- a/src/test/run-pass/auxiliary/thread-local-extern-static.rs +++ b/src/test/run-pass/auxiliary/thread-local-extern-static.rs @@ -9,7 +9,6 @@ // except according to those terms. #![feature(cfg_target_thread_local, const_fn, thread_local)] -#![feature(const_cell_new)] #![crate_type = "lib"] #[cfg(target_thread_local)] diff --git a/src/test/run-pass/box-of-array-of-drop-1.rs b/src/test/run-pass/box-of-array-of-drop-1.rs index 47b44863a7475..db055e6886a83 100644 --- a/src/test/run-pass/box-of-array-of-drop-1.rs +++ b/src/test/run-pass/box-of-array-of-drop-1.rs @@ -13,8 +13,6 @@ // ignore-emscripten no threads support -#![feature(const_atomic_usize_new)] - use std::thread; use std::sync::atomic::{AtomicUsize, Ordering}; diff --git a/src/test/run-pass/box-of-array-of-drop-2.rs b/src/test/run-pass/box-of-array-of-drop-2.rs index 54be4955baf5b..9dde53bb31dc5 100644 --- a/src/test/run-pass/box-of-array-of-drop-2.rs +++ b/src/test/run-pass/box-of-array-of-drop-2.rs @@ -13,8 +13,6 @@ // ignore-emscripten no threads support -#![feature(const_atomic_usize_new)] - use std::thread; use std::sync::atomic::{AtomicUsize, Ordering}; diff --git a/src/test/run-pass/const-fn-feature-flags.rs b/src/test/run-pass/const-fn-feature-flags.rs index 1e27a3edac808..a7736a2eb3431 100644 --- a/src/test/run-pass/const-fn-feature-flags.rs +++ b/src/test/run-pass/const-fn-feature-flags.rs @@ -8,9 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Test use of const fns in std using individual feature gates. - -#![feature(const_cell_new)] +// Test use of stabilized const fns in std formerly using individual feature gates. use std::cell::Cell; diff --git a/src/test/run-pass/const-size_of-align_of.rs b/src/test/run-pass/const-size_of-align_of.rs index d5547ea5add00..06fbe9bf4f639 100644 --- a/src/test/run-pass/const-size_of-align_of.rs +++ b/src/test/run-pass/const-size_of-align_of.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_fn, const_size_of, const_align_of)] +#![feature(const_fn)] use std::mem; diff --git a/src/test/run-pass/issue-17718-static-unsafe-interior.rs b/src/test/run-pass/issue-17718-static-unsafe-interior.rs index 66f70cdaeb08b..5f7629fa26777 100644 --- a/src/test/run-pass/issue-17718-static-unsafe-interior.rs +++ b/src/test/run-pass/issue-17718-static-unsafe-interior.rs @@ -10,9 +10,6 @@ // pretty-expanded FIXME #23616 -#![feature(core)] -#![feature(const_unsafe_cell_new)] - use std::marker; use std::cell::UnsafeCell; diff --git a/src/test/run-pass/issue-17718.rs b/src/test/run-pass/issue-17718.rs index 1b8fbc1ad2f5c..502e4a816640a 100644 --- a/src/test/run-pass/issue-17718.rs +++ b/src/test/run-pass/issue-17718.rs @@ -10,10 +10,6 @@ // aux-build:issue-17718-aux.rs - -#![feature(core)] -#![feature(const_atomic_usize_new)] - extern crate issue_17718_aux as other; use std::sync::atomic::{AtomicUsize, Ordering}; diff --git a/src/test/run-pass/issue-21486.rs b/src/test/run-pass/issue-21486.rs index 23d06c4324da6..a61f294465d98 100644 --- a/src/test/run-pass/issue-21486.rs +++ b/src/test/run-pass/issue-21486.rs @@ -12,8 +12,6 @@ // created via FRU and control-flow breaks in the middle of // construction. -#![feature(const_atomic_usize_new)] - use std::sync::atomic::{Ordering, AtomicUsize}; #[derive(Debug)] diff --git a/src/test/run-pass/issue-26655.rs b/src/test/run-pass/issue-26655.rs index 3e252b8629e12..6d43451af6b91 100644 --- a/src/test/run-pass/issue-26655.rs +++ b/src/test/run-pass/issue-26655.rs @@ -12,8 +12,6 @@ // Check that the destructors of simple enums are run on unwinding -#![feature(const_atomic_usize_new)] - use std::sync::atomic::{Ordering, AtomicUsize}; use std::thread; diff --git a/src/test/run-pass/issue-27997.rs b/src/test/run-pass/issue-27997.rs index dab42e48e1645..9dba477a7e5e5 100644 --- a/src/test/run-pass/issue-27997.rs +++ b/src/test/run-pass/issue-27997.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_atomic_usize_new)] - use std::sync::atomic::{Ordering, AtomicUsize}; use std::mem; diff --git a/src/test/run-pass/nested-vec-3.rs b/src/test/run-pass/nested-vec-3.rs index 9141b5f29ceb9..d1a63b4439276 100644 --- a/src/test/run-pass/nested-vec-3.rs +++ b/src/test/run-pass/nested-vec-3.rs @@ -14,8 +14,6 @@ // the contents implement Drop and we hit a panic in the middle of // construction. -#![feature(const_atomic_usize_new)] - use std::thread; use std::sync::atomic::{AtomicUsize, Ordering}; diff --git a/src/test/run-pass/panic-handler-chain.rs b/src/test/run-pass/panic-handler-chain.rs index c5dc8ccd2eeaf..8d692f2241bc7 100644 --- a/src/test/run-pass/panic-handler-chain.rs +++ b/src/test/run-pass/panic-handler-chain.rs @@ -11,7 +11,6 @@ // ignore-emscripten no threads support #![feature(panic_handler, std_panic)] -#![feature(const_atomic_usize_new)] use std::sync::atomic::{AtomicUsize, Ordering}; use std::panic; diff --git a/src/test/run-pass/panic-handler-set-twice.rs b/src/test/run-pass/panic-handler-set-twice.rs index 8bf2683cd9feb..81da13afaa59e 100644 --- a/src/test/run-pass/panic-handler-set-twice.rs +++ b/src/test/run-pass/panic-handler-set-twice.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. #![feature(panic_handler, std_panic)] -#![feature(const_atomic_usize_new)] // ignore-emscripten no threads support diff --git a/src/test/run-pass/struct-order-of-eval-3.rs b/src/test/run-pass/struct-order-of-eval-3.rs index cf93133d20593..3059c8e9e8963 100644 --- a/src/test/run-pass/struct-order-of-eval-3.rs +++ b/src/test/run-pass/struct-order-of-eval-3.rs @@ -11,8 +11,6 @@ // Checks that functional-record-update order-of-eval is as expected // even when no Drop-implementations are involved. -#![feature(const_atomic_usize_new)] - use std::sync::atomic::{Ordering, AtomicUsize}; struct W { wrapped: u32 } diff --git a/src/test/run-pass/struct-order-of-eval-4.rs b/src/test/run-pass/struct-order-of-eval-4.rs index d442923478f1f..2ae9ebc34e1b3 100644 --- a/src/test/run-pass/struct-order-of-eval-4.rs +++ b/src/test/run-pass/struct-order-of-eval-4.rs @@ -11,8 +11,6 @@ // Checks that struct-literal expression order-of-eval is as expected // even when no Drop-implementations are involved. -#![feature(const_atomic_usize_new)] - use std::sync::atomic::{Ordering, AtomicUsize}; struct W { wrapped: u32 } diff --git a/src/test/ui/span/dropck_arr_cycle_checked.rs b/src/test/ui/span/dropck_arr_cycle_checked.rs index 995a198271c11..455c9dc57f52b 100644 --- a/src/test/ui/span/dropck_arr_cycle_checked.rs +++ b/src/test/ui/span/dropck_arr_cycle_checked.rs @@ -13,7 +13,7 @@ // // (Compare against compile-fail/dropck_vec_cycle_checked.rs) -#![feature(const_atomic_usize_new)] + use std::cell::Cell; use id::Id; diff --git a/src/test/ui/span/dropck_vec_cycle_checked.rs b/src/test/ui/span/dropck_vec_cycle_checked.rs index 5bcaa71f73c29..5e7cb79680c1e 100644 --- a/src/test/ui/span/dropck_vec_cycle_checked.rs +++ b/src/test/ui/span/dropck_vec_cycle_checked.rs @@ -12,7 +12,7 @@ // // (Compare against compile-fail/dropck_arr_cycle_checked.rs) -#![feature(const_atomic_usize_new)] + use std::cell::Cell; use id::Id; diff --git a/src/test/ui/span/vec-must-not-hide-type-from-dropck.rs b/src/test/ui/span/vec-must-not-hide-type-from-dropck.rs index d99f3bb19dbad..c4596e7c3684d 100644 --- a/src/test/ui/span/vec-must-not-hide-type-from-dropck.rs +++ b/src/test/ui/span/vec-must-not-hide-type-from-dropck.rs @@ -23,7 +23,7 @@ // conditions above to be satisfied, meaning that if the dropck is // sound, it should reject this code. -#![feature(const_atomic_usize_new)] + use std::cell::Cell; use id::Id;