diff --git a/src/libcollectionstest/lib.rs b/src/libcollectionstest/lib.rs index 9b50478472f..0e3f9d5aadd 100644 --- a/src/libcollectionstest/lib.rs +++ b/src/libcollectionstest/lib.rs @@ -14,6 +14,7 @@ #![feature(collections)] #![feature(collections_drain)] #![feature(core)] +#![feature(const_fn)] #![feature(hash)] #![feature(rand)] #![feature(rustc_private)] diff --git a/src/libcoretest/lib.rs b/src/libcoretest/lib.rs index 3d14b3f3c81..6ec3f5b7869 100644 --- a/src/libcoretest/lib.rs +++ b/src/libcoretest/lib.rs @@ -14,6 +14,7 @@ #![feature(box_syntax)] #![feature(unboxed_closures)] #![feature(core)] +#![feature(const_fn)] #![feature(test)] #![feature(rand)] #![feature(unicode)] diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index 4c92162b2d6..15767024ba8 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -173,6 +173,7 @@ #![feature(staged_api)] #![feature(box_syntax)] #![feature(core)] +#![feature(const_fn)] #![feature(std_misc)] use std::boxed; diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index c92bb81c5fb..4a715ca621c 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -29,6 +29,7 @@ #![feature(box_patterns)] #![feature(box_syntax)] #![feature(collections)] +#![feature(const_fn)] #![feature(core)] #![feature(duration)] #![feature(duration_span)] diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 8866e7ff19d..f25c6eb21a4 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -30,6 +30,7 @@ #![feature(box_syntax)] #![feature(collections)] #![feature(core)] +#![feature(const_fn)] #![feature(libc)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] diff --git a/src/test/auxiliary/issue-17718.rs b/src/test/auxiliary/issue-17718.rs index b347e674f0a..373fc042175 100644 --- a/src/test/auxiliary/issue-17718.rs +++ b/src/test/auxiliary/issue-17718.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(const_fn)] + use std::sync::atomic; pub const C1: usize = 1; diff --git a/src/test/compile-fail/dropck_arr_cycle_checked.rs b/src/test/compile-fail/dropck_arr_cycle_checked.rs index c9713ebcebe..19f790ddc90 100644 --- a/src/test/compile-fail/dropck_arr_cycle_checked.rs +++ b/src/test/compile-fail/dropck_arr_cycle_checked.rs @@ -13,6 +13,8 @@ // // (Compare against compile-fail/dropck_vec_cycle_checked.rs) +#![feature(const_fn)] + use std::cell::Cell; use id::Id; diff --git a/src/test/compile-fail/dropck_tarena_cycle_checked.rs b/src/test/compile-fail/dropck_tarena_cycle_checked.rs index 9309f5a243c..584e5eabf0c 100644 --- a/src/test/compile-fail/dropck_tarena_cycle_checked.rs +++ b/src/test/compile-fail/dropck_tarena_cycle_checked.rs @@ -17,6 +17,7 @@ // for the error message we see here.) #![allow(unstable)] +#![feature(const_fn)] extern crate arena; diff --git a/src/test/compile-fail/dropck_trait_cycle_checked.rs b/src/test/compile-fail/dropck_trait_cycle_checked.rs index 1d8c7e9ac3e..6e0679da949 100644 --- a/src/test/compile-fail/dropck_trait_cycle_checked.rs +++ b/src/test/compile-fail/dropck_trait_cycle_checked.rs @@ -13,6 +13,8 @@ // // (Compare against compile-fail/dropck_vec_cycle_checked.rs) +#![feature(const_fn)] + use std::cell::Cell; use id::Id; diff --git a/src/test/compile-fail/dropck_vec_cycle_checked.rs b/src/test/compile-fail/dropck_vec_cycle_checked.rs index 8722246bb4e..bc33ff8399a 100644 --- a/src/test/compile-fail/dropck_vec_cycle_checked.rs +++ b/src/test/compile-fail/dropck_vec_cycle_checked.rs @@ -12,6 +12,8 @@ // // (Compare against compile-fail/dropck_arr_cycle_checked.rs) +#![feature(const_fn)] + use std::cell::Cell; use id::Id; diff --git a/src/test/compile-fail/functional-struct-update-respects-privacy.rs b/src/test/compile-fail/functional-struct-update-respects-privacy.rs index 3f41401eb69..d2df0d9ef27 100644 --- a/src/test/compile-fail/functional-struct-update-respects-privacy.rs +++ b/src/test/compile-fail/functional-struct-update-respects-privacy.rs @@ -10,6 +10,8 @@ // RFC 736 (and Issue 21407): functional struct update should respect privacy. +#![feature(const_fn)] + // The `foo` module attempts to maintains an invariant that each `S` // has a unique `u64` id. use self::foo::S; diff --git a/src/test/compile-fail/issue-17718-const-borrow.rs b/src/test/compile-fail/issue-17718-const-borrow.rs index 12a9a274631..ec6d1141c1a 100644 --- a/src/test/compile-fail/issue-17718-const-borrow.rs +++ b/src/test/compile-fail/issue-17718-const-borrow.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(const_fn)] + use std::cell::UnsafeCell; const A: UnsafeCell = UnsafeCell::new(1); diff --git a/src/test/compile-fail/issue-7364.rs b/src/test/compile-fail/issue-7364.rs index 999e5f9db2d..7d0a9007829 100644 --- a/src/test/compile-fail/issue-7364.rs +++ b/src/test/compile-fail/issue-7364.rs @@ -9,6 +9,7 @@ // except according to those terms. #![feature(box_syntax)] +#![feature(const_fn)] use std::cell::RefCell; diff --git a/src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs b/src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs index 0b2112edf72..37528959684 100644 --- a/src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs +++ b/src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs @@ -23,6 +23,8 @@ // conditions above to be satisfied, meaning that if the dropck is // sound, it should reject this code. +#![feature(const_fn)] + use std::cell::Cell; use id::Id; diff --git a/src/test/debuginfo/constant-debug-locs.rs b/src/test/debuginfo/constant-debug-locs.rs index 72448ca2e00..8032b53e9dd 100644 --- a/src/test/debuginfo/constant-debug-locs.rs +++ b/src/test/debuginfo/constant-debug-locs.rs @@ -15,6 +15,7 @@ #![allow(dead_code, unused_variables)] #![omit_gdb_pretty_printer_section] #![feature(std_misc, core)] +#![feature(const_fn)] // This test makes sure that the compiler doesn't crash when trying to assign // debug locations to const-expressions. 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 2c3d7ef39e4..b13e34256d2 100644 --- a/src/test/run-pass-valgrind/cast-enum-with-dtor.rs +++ b/src/test/run-pass-valgrind/cast-enum-with-dtor.rs @@ -9,6 +9,7 @@ // except according to those terms. #![allow(dead_code)] +#![feature(const_fn)] // check dtor calling order when casting enums. diff --git a/src/test/run-pass/associated-types-project-from-type-param-via-bound-in-where-clause.rs b/src/test/run-pass/associated-types-project-from-type-param-via-bound-in-where-clause.rs index 5ceb1013ad8..8dc7d79ec2a 100644 --- a/src/test/run-pass/associated-types-project-from-type-param-via-bound-in-where-clause.rs +++ b/src/test/run-pass/associated-types-project-from-type-param-via-bound-in-where-clause.rs @@ -12,6 +12,8 @@ // `Item` originates in a where-clause, not the declaration of // `T`. Issue #20300. +#![feature(const_fn)] + use std::marker::{PhantomData}; use std::sync::atomic::{AtomicUsize}; use std::sync::atomic::Ordering::SeqCst; 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 1c7359a0fad..e889d74c7cc 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 @@ -11,6 +11,8 @@ // Test that we cleanup a fixed size Box<[D; k]> properly when D has a // destructor. +#![feature(const_fn)] + 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 ad781f00356..f108ef4f5d2 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 @@ -11,6 +11,8 @@ // Test that we cleanup dynamic sized Box<[D]> properly when D has a // destructor. +#![feature(const_fn)] + use std::thread; use std::sync::atomic::{AtomicUsize, Ordering}; diff --git a/src/test/run-pass/const-fn-method.rs b/src/test/run-pass/const-fn-method.rs index dc02758fe50..42c7a47c59d 100644 --- a/src/test/run-pass/const-fn-method.rs +++ b/src/test/run-pass/const-fn-method.rs @@ -10,7 +10,7 @@ #![feature(const_fn)] -struct Foo { val: u32 } +struct Foo { value: u32 } impl Foo { const fn new() -> Foo { 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 c18d51e84d8..993e5e1c1e6 100644 --- a/src/test/run-pass/issue-17718-static-unsafe-interior.rs +++ b/src/test/run-pass/issue-17718-static-unsafe-interior.rs @@ -11,6 +11,8 @@ // pretty-expanded FIXME #23616 #![feature(core)] +#![feature(const_fn)] + 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 457bbb23e18..2bb69d105ff 100644 --- a/src/test/run-pass/issue-17718.rs +++ b/src/test/run-pass/issue-17718.rs @@ -12,6 +12,7 @@ #![feature(core)] +#![feature(const_fn)] extern crate issue_17718 as other; diff --git a/src/test/run-pass/issue-21486.rs b/src/test/run-pass/issue-21486.rs index c20237f1f86..699189a4e6a 100644 --- a/src/test/run-pass/issue-21486.rs +++ b/src/test/run-pass/issue-21486.rs @@ -12,6 +12,7 @@ // created via FRU and control-flow breaks in the middle of // construction. +#![feature(const_fn)] use std::sync::atomic::{Ordering, AtomicUsize}; diff --git a/src/test/run-pass/nested-vec-3.rs b/src/test/run-pass/nested-vec-3.rs index e59900caf07..89ac6261583 100644 --- a/src/test/run-pass/nested-vec-3.rs +++ b/src/test/run-pass/nested-vec-3.rs @@ -12,6 +12,7 @@ // the contents implement Drop and we hit a panic in the middle of // construction. +#![feature(const_fn)] use std::thread; use std::sync::atomic::{AtomicUsize, Ordering}; 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 c0ed4ea3ce8..b67eb205396 100644 --- a/src/test/run-pass/struct-order-of-eval-3.rs +++ b/src/test/run-pass/struct-order-of-eval-3.rs @@ -11,6 +11,7 @@ // Checks that functional-record-update order-of-eval is as expected // even when no Drop-implementations are involved. +#![feature(const_fn)] use std::sync::atomic::{Ordering, AtomicUsize}; 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 83ea0e3ab74..20d27d8b309 100644 --- a/src/test/run-pass/struct-order-of-eval-4.rs +++ b/src/test/run-pass/struct-order-of-eval-4.rs @@ -11,6 +11,7 @@ // Checks that struct-literal expression order-of-eval is as expected // even when no Drop-implementations are involved. +#![feature(const_fn)] use std::sync::atomic::{Ordering, AtomicUsize}; diff --git a/src/test/run-pass/vector-sort-panic-safe.rs b/src/test/run-pass/vector-sort-panic-safe.rs index f3c4ecb035e..209fe22207f 100644 --- a/src/test/run-pass/vector-sort-panic-safe.rs +++ b/src/test/run-pass/vector-sort-panic-safe.rs @@ -10,6 +10,7 @@ #![feature(rand, core)] +#![feature(const_fn)] use std::sync::atomic::{AtomicUsize, Ordering}; use std::__rand::{thread_rng, Rng};