diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 676c977514f..452d2b1472f 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -88,7 +88,8 @@ #![feature(box_syntax)] #![feature(cfg_target_has_atomic)] #![feature(coerce_unsized)] -#![feature(const_fn)] +#![cfg_attr(stage0, feature(const_fn))] +#![cfg_attr(not(stage0), feature(min_const_fn))] #![feature(core_intrinsics)] #![feature(custom_attribute)] #![feature(dropck_eyepatch)] diff --git a/src/liballoc/tests/lib.rs b/src/liballoc/tests/lib.rs index 3a84f9e7e47..710c659ac53 100644 --- a/src/liballoc/tests/lib.rs +++ b/src/liballoc/tests/lib.rs @@ -11,7 +11,8 @@ #![feature(allocator_api)] #![feature(alloc_system)] #![feature(box_syntax)] -#![feature(const_fn)] +#![cfg_attr(stage0, feature(const_fn))] +#![cfg_attr(not(stage0), feature(min_const_fn))] #![feature(drain_filter)] #![feature(exact_size_is_empty)] #![feature(pattern)] diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index d014f319564..d79281666d6 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -42,7 +42,8 @@ #![feature(box_patterns)] #![feature(box_syntax)] -#![feature(const_fn)] +#![cfg_attr(stage0, feature(const_fn))] +#![cfg_attr(not(stage0), feature(min_const_fn))] #![feature(core_intrinsics)] #![feature(drain_filter)] #![cfg_attr(windows, feature(libc))] diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs index f91ff3642cd..6f087221b80 100644 --- a/src/librustc_mir/lib.rs +++ b/src/librustc_mir/lib.rs @@ -23,7 +23,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment! #![feature(box_patterns)] #![feature(box_syntax)] #![feature(crate_visibility_modifier)] -#![feature(const_fn)] #![feature(core_intrinsics)] #![feature(decl_macro)] #![cfg_attr(stage0, feature(macro_vis_matcher))] diff --git a/src/librustc_target/lib.rs b/src/librustc_target/lib.rs index 1e70a806cce..e4d958e3b6f 100644 --- a/src/librustc_target/lib.rs +++ b/src/librustc_target/lib.rs @@ -22,7 +22,8 @@ html_root_url = "https://doc.rust-lang.org/nightly/")] #![feature(box_syntax)] -#![feature(const_fn)] +#![cfg_attr(stage0, feature(const_fn))] +#![cfg_attr(not(stage0), feature(min_const_fn))] #![cfg_attr(not(stage0), feature(nll))] #![cfg_attr(not(stage0), feature(infer_outlives_requirements))] #![feature(slice_patterns)] diff --git a/src/test/codegen-units/item-collection/unreferenced-const-fn.rs b/src/test/codegen-units/item-collection/unreferenced-const-fn.rs index c2ff846721c..14624176436 100644 --- a/src/test/codegen-units/item-collection/unreferenced-const-fn.rs +++ b/src/test/codegen-units/item-collection/unreferenced-const-fn.rs @@ -13,7 +13,7 @@ // NB: We do not expect *any* monomorphization to be generated here. -#![feature(const_fn)] +#![feature(min_const_fn)] #![deny(dead_code)] #![crate_type = "rlib"] diff --git a/src/test/codegen/link-dead-code.rs b/src/test/codegen/link-dead-code.rs index 9cabcd9157a..3ea20aa921e 100644 --- a/src/test/codegen/link-dead-code.rs +++ b/src/test/codegen/link-dead-code.rs @@ -10,7 +10,7 @@ // compile-flags:-Clink-dead-code -#![feature(const_fn)] +#![feature(min_const_fn)] #![crate_type = "rlib"] // This test makes sure that, when -Clink-dead-code is specified, we generate diff --git a/src/test/compile-fail/issue-43733-2.rs b/src/test/compile-fail/issue-43733-2.rs index a5ba9ef9bd3..fea81f0cc8f 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)] +#![feature(min_const_fn)] #![feature(cfg_target_thread_local, thread_local_internals)] // On platforms *without* `#[thread_local]`, use diff --git a/src/test/mir-opt/lower_128bit_debug_test.rs b/src/test/mir-opt/lower_128bit_debug_test.rs index 646c4312fc2..1bf740fdec6 100644 --- a/src/test/mir-opt/lower_128bit_debug_test.rs +++ b/src/test/mir-opt/lower_128bit_debug_test.rs @@ -15,7 +15,7 @@ // compile-flags: -Z lower_128bit_ops=yes -C debug_assertions=yes -#![feature(const_fn)] +#![feature(min_const_fn)] static TEST_SIGNED: i128 = const_signed(-222); static TEST_UNSIGNED: u128 = const_unsigned(200); diff --git a/src/test/mir-opt/lower_128bit_test.rs b/src/test/mir-opt/lower_128bit_test.rs index 72c0e33cd9e..235df8a6785 100644 --- a/src/test/mir-opt/lower_128bit_test.rs +++ b/src/test/mir-opt/lower_128bit_test.rs @@ -12,7 +12,7 @@ // compile-flags: -Z lower_128bit_ops=yes -C debug_assertions=no -O -#![feature(const_fn)] +#![feature(min_const_fn)] static TEST_SIGNED: i128 = const_signed(-222); static TEST_UNSIGNED: u128 = const_unsigned(200); diff --git a/src/test/run-fail/issue-29798.rs b/src/test/run-fail/issue-29798.rs index a77175975f9..30efe3b9ab2 100644 --- a/src/test/run-fail/issue-29798.rs +++ b/src/test/run-fail/issue-29798.rs @@ -10,7 +10,7 @@ // error-pattern:index out of bounds: the len is 5 but the index is 5 -#![feature(const_fn)] +#![feature(min_const_fn)] const fn test(x: usize) -> i32 { [42;5][x] } diff --git a/src/test/run-pass/auxiliary/const_fn_lib.rs b/src/test/run-pass/auxiliary/const_fn_lib.rs index be06e8dd570..6985a6527c8 100644 --- a/src/test/run-pass/auxiliary/const_fn_lib.rs +++ b/src/test/run-pass/auxiliary/const_fn_lib.rs @@ -11,6 +11,6 @@ // Crate that exports a const fn. Used for testing cross-crate. #![crate_type="rlib"] -#![feature(const_fn)] +#![feature(min_const_fn)] pub const fn foo() -> usize { 22 } diff --git a/src/test/run-pass/auxiliary/issue-36954.rs b/src/test/run-pass/auxiliary/issue-36954.rs index 832ee1d7c1b..5351a40916b 100644 --- a/src/test/run-pass/auxiliary/issue-36954.rs +++ b/src/test/run-pass/auxiliary/issue-36954.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_fn)] +#![feature(min_const_fn)] #![crate_type = "lib"] const fn foo(i: i32) -> i32 { diff --git a/src/test/run-pass/const-fn-const-eval.rs b/src/test/run-pass/const-fn-const-eval.rs index 77c70fe7f63..3fe27ca200c 100644 --- a/src/test/run-pass/const-fn-const-eval.rs +++ b/src/test/run-pass/const-fn-const-eval.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_fn)] +#![feature(min_const_fn)] const fn add(x: usize, y: usize) -> usize { x + y diff --git a/src/test/run-pass/const-fn-method.rs b/src/test/run-pass/const-fn-method.rs index 7d8d941439c..bed78f1e897 100644 --- a/src/test/run-pass/const-fn-method.rs +++ b/src/test/run-pass/const-fn-method.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_fn)] +#![feature(min_const_fn)] struct Foo { value: u32 } diff --git a/src/test/run-pass/const-fn-nested.rs b/src/test/run-pass/const-fn-nested.rs index 86f5dedc4d1..d5959a89e51 100644 --- a/src/test/run-pass/const-fn-nested.rs +++ b/src/test/run-pass/const-fn-nested.rs @@ -10,7 +10,7 @@ // Test a call whose argument is the result of another call. -#![feature(const_fn)] +#![feature(min_const_fn)] const fn sub(x: u32, y: u32) -> u32 { x - y diff --git a/src/test/run-pass/const-meth-pattern.rs b/src/test/run-pass/const-meth-pattern.rs index 3b27987f190..836716051d2 100644 --- a/src/test/run-pass/const-meth-pattern.rs +++ b/src/test/run-pass/const-meth-pattern.rs @@ -7,7 +7,7 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_fn)] +#![feature(min_const_fn)] struct A; diff --git a/src/test/run-pass/const-pattern-variant.rs b/src/test/run-pass/const-pattern-variant.rs index 104ab6e19db..689ae19e7d4 100644 --- a/src/test/run-pass/const-pattern-variant.rs +++ b/src/test/run-pass/const-pattern-variant.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_fn)] +#![feature(min_const_fn)] #[derive(PartialEq, Eq)] enum Cake { 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 06fbe9bf4f6..245dd673b51 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)] +#![feature(min_const_fn)] use std::mem; diff --git a/src/test/run-pass/const-unsafe-fn.rs b/src/test/run-pass/const-unsafe-fn.rs index 2511cfd0422..b267245b789 100644 --- a/src/test/run-pass/const-unsafe-fn.rs +++ b/src/test/run-pass/const-unsafe-fn.rs @@ -10,7 +10,7 @@ // A quick test of 'unsafe const fn' functionality -#![feature(const_fn)] +#![feature(min_const_fn)] const unsafe fn dummy(v: u32) -> u32 { !v diff --git a/src/test/run-pass/consts-in-patterns.rs b/src/test/run-pass/consts-in-patterns.rs index eec4c940585..574fb29e82c 100644 --- a/src/test/run-pass/consts-in-patterns.rs +++ b/src/test/run-pass/consts-in-patterns.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_fn)] +#![feature(min_const_fn)] const FOO: isize = 10; const BAR: isize = 3; diff --git a/src/test/run-pass/ctfe/ice-48279.rs b/src/test/run-pass/ctfe/ice-48279.rs index c435e5fdaab..f59a6810e3a 100644 --- a/src/test/run-pass/ctfe/ice-48279.rs +++ b/src/test/run-pass/ctfe/ice-48279.rs @@ -10,7 +10,7 @@ // https://github.com/rust-lang/rust/issues/48279 -#![feature(const_fn)] +#![feature(min_const_fn)] #[derive(PartialEq, Eq)] pub struct NonZeroU32 { diff --git a/src/test/run-pass/ctfe/match-const-fn-structs.rs b/src/test/run-pass/ctfe/match-const-fn-structs.rs index 0bb253d1a64..352958f4c6a 100644 --- a/src/test/run-pass/ctfe/match-const-fn-structs.rs +++ b/src/test/run-pass/ctfe/match-const-fn-structs.rs @@ -10,7 +10,7 @@ // https://github.com/rust-lang/rust/issues/46114 -#![feature(const_fn)] +#![feature(min_const_fn)] #[derive(Eq, PartialEq)] struct A { value: u32 } diff --git a/src/test/run-pass/ctfe/return-in-const-fn.rs b/src/test/run-pass/ctfe/return-in-const-fn.rs index d57d3bcb49a..87fdac4bfb4 100644 --- a/src/test/run-pass/ctfe/return-in-const-fn.rs +++ b/src/test/run-pass/ctfe/return-in-const-fn.rs @@ -10,7 +10,7 @@ // https://github.com/rust-lang/rust/issues/43754 -#![feature(const_fn)] +#![feature(min_const_fn)] const fn foo(x: usize) -> usize { return x; } diff --git a/src/test/run-pass/issue-28822.rs b/src/test/run-pass/issue-28822.rs index 5a010f2be7a..10482139a97 100644 --- a/src/test/run-pass/issue-28822.rs +++ b/src/test/run-pass/issue-28822.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_fn)] +#![feature(min_const_fn)] fn main() {} diff --git a/src/test/run-pass/issue-29927.rs b/src/test/run-pass/issue-29927.rs index 6d9adbcd579..3079d9de3c2 100644 --- a/src/test/run-pass/issue-29927.rs +++ b/src/test/run-pass/issue-29927.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_fn)] +#![feature(min_const_fn)] struct A { field: usize, } diff --git a/src/test/run-pass/issue-33537.rs b/src/test/run-pass/issue-33537.rs index 24f4c9f590b..7be79f3a450 100644 --- a/src/test/run-pass/issue-33537.rs +++ b/src/test/run-pass/issue-33537.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_fn)] +#![feature(min_const_fn)] const fn foo() -> *const i8 { b"foo" as *const _ as *const i8 diff --git a/src/test/run-pass/issue-37991.rs b/src/test/run-pass/issue-37991.rs index 9bdde02d006..9b3289e6785 100644 --- a/src/test/run-pass/issue-37991.rs +++ b/src/test/run-pass/issue-37991.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_fn)] +#![feature(min_const_fn)] const fn foo() -> i64 { 3 diff --git a/src/test/run-pass/issue29927-1.rs b/src/test/run-pass/issue29927-1.rs index 68271accb61..488bc6e6927 100644 --- a/src/test/run-pass/issue29927-1.rs +++ b/src/test/run-pass/issue29927-1.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_fn)] +#![feature(min_const_fn)] const fn f() -> usize { 5 } diff --git a/src/test/rustdoc/auxiliary/issue-27362.rs b/src/test/rustdoc/auxiliary/issue-27362.rs index 25de698cad1..0c1eedc86cc 100644 --- a/src/test/rustdoc/auxiliary/issue-27362.rs +++ b/src/test/rustdoc/auxiliary/issue-27362.rs @@ -10,7 +10,7 @@ // compile-flags: -Cmetadata=aux -#![feature(const_fn)] +#![feature(min_const_fn)] pub const fn foo() {} pub const unsafe fn bar() {} diff --git a/src/test/rustdoc/const-fn.rs b/src/test/rustdoc/const-fn.rs index c323681f60b..dc7a2799b46 100644 --- a/src/test/rustdoc/const-fn.rs +++ b/src/test/rustdoc/const-fn.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(const_fn)] +#![feature(min_const_fn)] #![crate_name = "foo"] // @has foo/fn.bar.html diff --git a/src/test/rustdoc/const.rs b/src/test/rustdoc/const.rs index 380feb941d6..49694e3ae08 100644 --- a/src/test/rustdoc/const.rs +++ b/src/test/rustdoc/const.rs @@ -10,7 +10,7 @@ #![crate_type="lib"] -#![feature(const_fn)] +#![feature(min_const_fn)] pub struct Foo; diff --git a/src/test/ui/borrowck/move-in-static-initializer-issue-38520.rs b/src/test/ui/borrowck/move-in-static-initializer-issue-38520.rs index 508e09318ae..d71c8462587 100644 --- a/src/test/ui/borrowck/move-in-static-initializer-issue-38520.rs +++ b/src/test/ui/borrowck/move-in-static-initializer-issue-38520.rs @@ -15,7 +15,7 @@ // permitted as `Foo` is not copy (even in a static/const // initializer). -#![feature(const_fn)] +#![feature(min_const_fn)] struct Foo(usize); diff --git a/src/test/ui/consts/auxiliary/const_fn_lib.rs b/src/test/ui/consts/auxiliary/const_fn_lib.rs index b0d5a6b1272..499227e71a7 100644 --- a/src/test/ui/consts/auxiliary/const_fn_lib.rs +++ b/src/test/ui/consts/auxiliary/const_fn_lib.rs @@ -11,6 +11,6 @@ // Crate that exports a const fn. Used for testing cross-crate. #![crate_type="rlib"] -#![feature(const_fn)] +#![feature(min_const_fn)] pub const fn foo() -> usize { 22 } //~ ERROR const fn is unstable diff --git a/src/test/ui/consts/const-eval/issue-43197.rs b/src/test/ui/consts/const-eval/issue-43197.rs index c0b45f0ba30..200f423f6e3 100644 --- a/src/test/ui/consts/const-eval/issue-43197.rs +++ b/src/test/ui/consts/const-eval/issue-43197.rs @@ -10,7 +10,7 @@ #![warn(const_err)] -#![feature(const_fn)] +#![feature(min_const_fn)] const fn foo(x: u32) -> u32 { x diff --git a/src/test/ui/consts/const-eval/issue-47971.rs b/src/test/ui/consts/const-eval/issue-47971.rs index f6a2db31d37..2bc860e3ef9 100644 --- a/src/test/ui/consts/const-eval/issue-47971.rs +++ b/src/test/ui/consts/const-eval/issue-47971.rs @@ -10,7 +10,7 @@ // compile-pass -#![feature(const_fn)] +#![feature(min_const_fn)] struct S(pub &'static u32, pub u32); diff --git a/src/test/ui/consts/const-pattern-not-const-evaluable.rs b/src/test/ui/consts/const-pattern-not-const-evaluable.rs index 87d5e13df6e..4f02b1eef3a 100644 --- a/src/test/ui/consts/const-pattern-not-const-evaluable.rs +++ b/src/test/ui/consts/const-pattern-not-const-evaluable.rs @@ -10,7 +10,7 @@ // compile-pass -#![feature(const_fn)] +#![feature(min_const_fn)] #[derive(PartialEq, Eq)] enum Cake { diff --git a/src/test/ui/consts/const-size_of-cycle.rs b/src/test/ui/consts/const-size_of-cycle.rs index fed8e1885de..04c054f8b6d 100644 --- a/src/test/ui/consts/const-size_of-cycle.rs +++ b/src/test/ui/consts/const-size_of-cycle.rs @@ -10,8 +10,6 @@ // error-pattern: cycle detected -#![feature(const_fn)] - struct Foo { bytes: [u8; std::mem::size_of::()] } diff --git a/src/test/ui/infinite/infinite-recursion-const-fn.rs b/src/test/ui/infinite/infinite-recursion-const-fn.rs index 4f1f6721450..63ae18cf9c2 100644 --- a/src/test/ui/infinite/infinite-recursion-const-fn.rs +++ b/src/test/ui/infinite/infinite-recursion-const-fn.rs @@ -10,7 +10,7 @@ //https://github.com/rust-lang/rust/issues/31364 -#![feature(const_fn)] +#![feature(min_const_fn)] const fn a() -> usize { b() } const fn b() -> usize { a() } const ARR: [i32; a()] = [5; 6]; //~ ERROR could not evaluate constant expression diff --git a/src/test/ui/issues/issue-44415.rs b/src/test/ui/issues/issue-44415.rs index 5d295510844..bd50f93945c 100644 --- a/src/test/ui/issues/issue-44415.rs +++ b/src/test/ui/issues/issue-44415.rs @@ -10,7 +10,7 @@ //~^^^^^^^^^^ ERROR cycle detected when computing layout of -#![feature(const_fn)] + #![feature(core_intrinsics)] use std::intrinsics; diff --git a/src/test/ui/unsafe/unsafe-const-fn.rs b/src/test/ui/unsafe/unsafe-const-fn.rs index 765e2059a4b..fe0bb7533a8 100644 --- a/src/test/ui/unsafe/unsafe-const-fn.rs +++ b/src/test/ui/unsafe/unsafe-const-fn.rs @@ -10,7 +10,7 @@ // A quick test of 'unsafe const fn' functionality -#![feature(const_fn)] +#![feature(min_const_fn)] const unsafe fn dummy(v: u32) -> u32 { !v