]> git.lizzy.rs Git - rust.git/commitdiff
Bless tests
authorDylan MacKenzie <ecstaticmorse@gmail.com>
Thu, 17 Sep 2020 17:32:07 +0000 (10:32 -0700)
committerDylan MacKenzie <ecstaticmorse@gmail.com>
Tue, 22 Sep 2020 17:05:58 +0000 (10:05 -0700)
35 files changed:
src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs
src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.stderr
src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs
src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr
src/test/ui/consts/const-fn-not-safe-for-const.rs
src/test/ui/consts/const-mut-refs/feature-gate-const_mut_refs.rs
src/test/ui/consts/const_let_assign3.rs
src/test/ui/consts/const_let_assign3.stderr
src/test/ui/consts/min_const_fn/bad_const_fn_body_ice.rs
src/test/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr
src/test/ui/consts/min_const_fn/min_const_fn.rs
src/test/ui/consts/min_const_fn/min_const_fn.stderr
src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs
src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr
src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs
src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr
src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs
src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr
src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs
src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr
src/test/ui/consts/miri_unleashed/abi-mismatch.stderr
src/test/ui/consts/unsizing-cast-non-null.rs
src/test/ui/consts/unsizing-cast-non-null.stderr
src/test/ui/consts/unstable-const-fn-in-libcore.rs
src/test/ui/consts/unstable-const-fn-in-libcore.stderr
src/test/ui/parser/fn-header-semantic-fail.rs
src/test/ui/parser/fn-header-semantic-fail.stderr
src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs
src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr
src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.gated.stderr
src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.rs
src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.stock.stderr
src/test/ui/rfc-2632-const-trait-impl/stability.rs
src/test/ui/rfc-2632-const-trait-impl/stability.stderr
src/test/ui/unsafe/ranged_ints2_const.rs

index 6469a65700dad155a796c78c3bba5b1b71639780..e18e0a83573eed5fe892254eb05af93a0ce1ba44 100644 (file)
@@ -7,7 +7,7 @@
 const extern fn bar() {
     unsafe {
         regular_in_block();
-        //~^ ERROR: can only call other `const fn` within a `const fn`
+        //~^ ERROR: calls in constant functions
     }
 }
 
@@ -16,7 +16,7 @@
 const extern fn foo() {
     unsafe {
         regular();
-        //~^ ERROR: can only call other `const fn` within a `const fn`
+        //~^ ERROR: calls in constant functions
     }
 }
 
index a9e2bcdbdd1504493a13f0fcf132c789c6215134..348387ff5f827521fe56fe87f9e740467e4e3140 100644 (file)
@@ -1,21 +1,15 @@
-error[E0723]: can only call other `const fn` within a `const fn`, but `regular_in_block` is not stable as `const fn`
+error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
   --> $DIR/const-extern-fn-call-extern-fn.rs:9:9
    |
 LL |         regular_in_block();
    |         ^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
 
-error[E0723]: can only call other `const fn` within a `const fn`, but `regular` is not stable as `const fn`
+error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
   --> $DIR/const-extern-fn-call-extern-fn.rs:18:9
    |
 LL |         regular();
    |         ^^^^^^^^^
-   |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
 
 error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0723`.
+For more information about this error, try `rustc --explain E0015`.
index 2854c086657168b61cbd6cd32aefa90cae1818d0..e0b9e5f33759e661b37d0ac9130dec6f746943a7 100644 (file)
@@ -6,7 +6,7 @@
 const unsafe extern fn use_float() { 1.0 + 1.0; }
 //~^ ERROR only int, `bool` and `char` operations are stable in const fn
 const extern "C" fn ptr_cast(val: *const u8) { val as usize; }
-//~^ ERROR casting pointers to ints is unstable in const fn
+//~^ ERROR casting pointers to integers
 
 
 fn main() {}
index 146d119fc8f7fcdd43878cbcf5d282133b5ccd18..5ca44b3fa7e654b13ee1796d88770887e0a36ca4 100644 (file)
@@ -16,15 +16,16 @@ LL | const unsafe extern fn use_float() { 1.0 + 1.0; }
    = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
    = help: add `#![feature(const_fn)]` to the crate attributes to enable
 
-error[E0723]: casting pointers to ints is unstable in const fn
+error[E0658]: casting pointers to integers in constant functions is unstable
   --> $DIR/const-extern-fn-min-const-fn.rs:8:48
    |
 LL | const extern "C" fn ptr_cast(val: *const u8) { val as usize; }
    |                                                ^^^^^^^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = note: see issue #51910 <https://github.com/rust-lang/rust/issues/51910> for more information
+   = help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable
 
 error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0723`.
+Some errors have detailed explanations: E0658, E0723.
+For more information about an error, try `rustc --explain E0658`.
index 085ff5c58e60c6c68f693ad5eec77ce2fdd75fae..0446ece421eff33e1838e76c25f611ad4bb40f19 100644 (file)
@@ -1,6 +1,6 @@
 // Test that we can't call random fns in a const fn or do other bad things.
 
-#![feature(const_fn, const_transmute)]
+#![feature(const_fn, const_fn_transmute)]
 
 use std::mem::transmute;
 
index 2207599815ee8056198f2a3bbdcb03ffa93bab66..f31543af590d66c05e02788aba08d349687af5b6 100644 (file)
@@ -2,6 +2,7 @@ fn main() {
     foo(&mut 5);
 }
 
-const fn foo(x: &mut i32) -> i32 { //~ ERROR mutable references in const fn are unstable
+const fn foo(x: &mut i32) -> i32 { //~ ERROR mutable references in const fn
     *x + 1
+
 }
index f993a427b4899dbf591ac718ace8bd7553f3ae79..9d5ccb880aa1b6d71924f3a7b811bd058cf8e15d 100644 (file)
@@ -6,8 +6,8 @@ struct S {
 
 impl S {
     const fn foo(&mut self, x: u32) {
+        //~^ ERROR mutable references
         self.state = x;
-        //~^ contains unimplemented expression
     }
 }
 
index dd05a4c0bb069c9ff3184829fb0aea8990fb3954..785d9c8c2a5fb7fbf263474c32b5b3dac3f0043f 100644 (file)
@@ -1,10 +1,11 @@
-error[E0019]: constant function contains unimplemented expression type
-  --> $DIR/const_let_assign3.rs:9:9
+error[E0723]: mutable references in const fn are unstable
+  --> $DIR/const_let_assign3.rs:8:18
    |
-LL |         self.state = x;
-   |         ^^^^^^^^^^^^^^
+LL |     const fn foo(&mut self, x: u32) {
+   |                  ^^^^^^^^^
    |
-   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
+   = help: add `#![feature(const_fn)]` to the crate attributes to enable
 
 error[E0764]: mutable references are not allowed in constants
   --> $DIR/const_let_assign3.rs:16:5
@@ -28,5 +29,5 @@ LL |     *y = 42;
 
 error: aborting due to 4 previous errors
 
-Some errors have detailed explanations: E0019, E0764.
+Some errors have detailed explanations: E0019, E0723, E0764.
 For more information about an error, try `rustc --explain E0019`.
index 3e42cb8c1b07480bb57ea6e5f5f854626b6c68b3..589085871fba967c9958dd19b2c5d5d01b23f2bd 100644 (file)
@@ -1,5 +1,8 @@
 const fn foo(a: i32) -> Vec<i32> {
-    vec![1, 2, 3] //~ ERROR heap allocations are not allowed in const fn
+    vec![1, 2, 3]
+    //~^ ERROR allocations are not allowed
+    //~| ERROR unimplemented expression type
+    //~| ERROR calls in constant functions
 }
 
 fn main() {}
index 39b223062e9865fa140b75399420dda0e05cec5b..0f16890141f6bf5fa1b2afc8a17fbb29d4203f9d 100644 (file)
@@ -1,13 +1,29 @@
-error[E0723]: heap allocations are not allowed in const fn
+error[E0010]: allocations are not allowed in constant functions
+  --> $DIR/bad_const_fn_body_ice.rs:2:5
+   |
+LL |     vec![1, 2, 3]
+   |     ^^^^^^^^^^^^^ allocation not allowed in constant functions
+   |
+   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0019]: constant function contains unimplemented expression type
+  --> $DIR/bad_const_fn_body_ice.rs:2:5
+   |
+LL |     vec![1, 2, 3]
+   |     ^^^^^^^^^^^^^
+   |
+   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
   --> $DIR/bad_const_fn_body_ice.rs:2:5
    |
 LL |     vec![1, 2, 3]
    |     ^^^^^^^^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: aborting due to previous error
+error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0723`.
+Some errors have detailed explanations: E0010, E0015, E0019.
+For more information about an error, try `rustc --explain E0010`.
index 2ebd9dd10c5123014b2b3b4c6d1c4a72971d8098..5dd70acb6ff1c6cec1e013dbd5d32da6cc93fc61 100644 (file)
@@ -78,25 +78,25 @@ const fn foo11<T: std::fmt::Display>(t: T) -> T { t }
 const fn foo11_2<T: Send>(t: T) -> T { t }
 //~^ ERROR trait bounds other than `Sized` on const fn parameters are unstable
 const fn foo19(f: f32) -> f32 { f * 2.0 }
-//~^ ERROR only int, `bool` and `char` operations are stable in const fn
+//~^ ERROR int, `bool` and `char` operations
 const fn foo19_2(f: f32) -> f32 { 2.0 - f }
-//~^ ERROR only int, `bool` and `char` operations are stable in const fn
+//~^ ERROR int, `bool` and `char` operations
 const fn foo19_3(f: f32) -> f32 { -f }
-//~^ ERROR only int and `bool` operations are stable in const fn
+//~^ ERROR int, `bool` and `char` operations
 const fn foo19_4(f: f32, g: f32) -> f32 { f / g }
-//~^ ERROR only int, `bool` and `char` operations are stable in const fn
+//~^ ERROR int, `bool` and `char` operations
 
 static BAR: u32 = 42;
-const fn foo25() -> u32 { BAR } //~ ERROR cannot access `static` items in const fn
-const fn foo26() -> &'static u32 { &BAR } //~ ERROR cannot access `static` items
+const fn foo25() -> u32 { BAR } //~ ERROR cannot refer to statics
+const fn foo26() -> &'static u32 { &BAR } //~ ERROR cannot refer to statics
 const fn foo30(x: *const u32) -> usize { x as usize }
-//~^ ERROR casting pointers to ints is unstable
+//~^ ERROR casting pointers to integers
 const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } }
-//~^ ERROR casting pointers to ints is unstable
+//~^ ERROR casting pointers to integers
 const fn foo30_2(x: *mut u32) -> usize { x as usize }
-//~^ ERROR casting pointers to ints is unstable
+//~^ ERROR casting pointers to integers
 const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } }
-//~^ ERROR casting pointers to ints is unstable
+//~^ ERROR casting pointers to integers
 const fn foo30_6() -> bool { let x = true; x }
 const fn inc(x: &mut i32) { *x += 1 }
 //~^ ERROR mutable references in const fn are unstable
index 9b55b6c6f3bbc97bad469192d7230db86eb9093f..d4498f061c64bf71ca1ff6c9bef611fbf40bd826 100644 (file)
@@ -94,7 +94,7 @@ LL | const fn foo19_2(f: f32) -> f32 { 2.0 - f }
    = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
    = help: add `#![feature(const_fn)]` to the crate attributes to enable
 
-error[E0723]: only int and `bool` operations are stable in const fn
+error[E0723]: only int, `bool` and `char` operations are stable in const fn
   --> $DIR/min_const_fn.rs:84:35
    |
 LL | const fn foo19_3(f: f32) -> f32 { -f }
@@ -112,59 +112,57 @@ LL | const fn foo19_4(f: f32, g: f32) -> f32 { f / g }
    = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
    = help: add `#![feature(const_fn)]` to the crate attributes to enable
 
-error[E0723]: cannot access `static` items in const fn
+error[E0013]: constant functions cannot refer to statics
   --> $DIR/min_const_fn.rs:90:27
    |
 LL | const fn foo25() -> u32 { BAR }
    |                           ^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = help: consider extracting the value of the `static` to a `const`, and referring to that
 
-error[E0723]: cannot access `static` items in const fn
+error[E0013]: constant functions cannot refer to statics
   --> $DIR/min_const_fn.rs:91:37
    |
 LL | const fn foo26() -> &'static u32 { &BAR }
    |                                     ^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = help: consider extracting the value of the `static` to a `const`, and referring to that
 
-error[E0723]: casting pointers to ints is unstable in const fn
+error[E0658]: casting pointers to integers in constant functions is unstable
   --> $DIR/min_const_fn.rs:92:42
    |
 LL | const fn foo30(x: *const u32) -> usize { x as usize }
    |                                          ^^^^^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = note: see issue #51910 <https://github.com/rust-lang/rust/issues/51910> for more information
+   = help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable
 
-error[E0723]: casting pointers to ints is unstable in const fn
+error[E0658]: casting pointers to integers in constant functions is unstable
   --> $DIR/min_const_fn.rs:94:63
    |
 LL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } }
    |                                                               ^^^^^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = note: see issue #51910 <https://github.com/rust-lang/rust/issues/51910> for more information
+   = help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable
 
-error[E0723]: casting pointers to ints is unstable in const fn
+error[E0658]: casting pointers to integers in constant functions is unstable
   --> $DIR/min_const_fn.rs:96:42
    |
 LL | const fn foo30_2(x: *mut u32) -> usize { x as usize }
    |                                          ^^^^^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = note: see issue #51910 <https://github.com/rust-lang/rust/issues/51910> for more information
+   = help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable
 
-error[E0723]: casting pointers to ints is unstable in const fn
+error[E0658]: casting pointers to integers in constant functions is unstable
   --> $DIR/min_const_fn.rs:98:63
    |
 LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } }
    |                                                               ^^^^^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = note: see issue #51910 <https://github.com/rust-lang/rust/issues/51910> for more information
+   = help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable
 
 error[E0723]: mutable references in const fn are unstable
   --> $DIR/min_const_fn.rs:101:14
@@ -267,5 +265,5 @@ LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
 
 error: aborting due to 30 previous errors
 
-Some errors have detailed explanations: E0493, E0723.
-For more information about an error, try `rustc --explain E0493`.
+Some errors have detailed explanations: E0013, E0493, E0658, E0723.
+For more information about an error, try `rustc --explain E0013`.
index df10f3496c3c8e12310a95ccee608df0c1bfc3f3..b83fdf7c656cdfefc518038eaa88f52c11776d78 100644 (file)
@@ -13,7 +13,7 @@ const fn foo() -> u32 { 42 }
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
 // can't call non-min_const_fn
-const fn bar() -> u32 { foo() } //~ ERROR can only call other `const fn`
+const fn bar() -> u32 { foo() } //~ ERROR not yet stable as a const fn
 
 #[unstable(feature = "rust1", issue = "none")]
 const fn foo2() -> u32 { 42 }
@@ -21,12 +21,13 @@ const fn foo2() -> u32 { 42 }
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
 // can't call non-min_const_fn
-const fn bar2() -> u32 { foo2() } //~ ERROR can only call other `const fn`
+const fn bar2() -> u32 { foo2() } //~ ERROR not yet stable as a const fn
 
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
 // conformity is required, even with `const_fn` feature gate
-const fn bar3() -> u32 { (5f32 + 6f32) as u32 } //~ ERROR only int, `bool` and `char` operations
+const fn bar3() -> u32 { (5f32 + 6f32) as u32 }
+//~^ ERROR const-stable function cannot use `#[feature(const_fn)]`
 
 // check whether this function cannot be called even with the feature gate active
 #[unstable(feature = "foo2", issue = "none")]
@@ -35,6 +36,6 @@ const fn foo2_gated() -> u32 { 42 }
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
 // can't call non-min_const_fn
-const fn bar2_gated() -> u32 { foo2_gated() } //~ ERROR can only call other `const fn`
+const fn bar2_gated() -> u32 { foo2_gated() } //~ ERROR not yet stable as a const fn
 
 fn main() {}
index bef4f240eeb8b45ae4a9e09d7105a5f61735b022..a1f1f6f52ab2ac2031c3582a110a6b7009740eb9 100644 (file)
@@ -1,39 +1,38 @@
-error[E0723]: can only call other `const fn` within a `const fn`, but `foo` is not stable as `const fn`
+error: `foo` is not yet stable as a const fn
   --> $DIR/min_const_fn_libstd_stability.rs:16:25
    |
 LL | const fn bar() -> u32 { foo() }
    |                         ^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = help: Const-stable functions can only call other const-stable functions
 
-error[E0723]: can only call other `const fn` within a `const fn`, but `foo2` is not stable as `const fn`
+error: `foo2` is not yet stable as a const fn
   --> $DIR/min_const_fn_libstd_stability.rs:24:26
    |
 LL | const fn bar2() -> u32 { foo2() }
    |                          ^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = help: Const-stable functions can only call other const-stable functions
 
-error[E0723]: only int, `bool` and `char` operations are stable in const fn
+error: const-stable function cannot use `#[feature(const_fn)]`
   --> $DIR/min_const_fn_libstd_stability.rs:29:26
    |
 LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 }
    |                          ^^^^^^^^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = note: otherwise `#[allow_internal_unstable]` can be used to bypass stability checks
+help: if it is not part of the public API, make this function unstably const
+   |
+LL | #[rustc_const_unstable(feature = "...", issue = "...")]
+   |
 
-error[E0723]: can only call other `const fn` within a `const fn`, but `foo2_gated` is not stable as `const fn`
-  --> $DIR/min_const_fn_libstd_stability.rs:38:32
+error: `foo2_gated` is not yet stable as a const fn
+  --> $DIR/min_const_fn_libstd_stability.rs:39:32
    |
 LL | const fn bar2_gated() -> u32 { foo2_gated() }
    |                                ^^^^^^^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = help: Const-stable functions can only call other const-stable functions
 
 error: aborting due to 4 previous errors
 
-For more information about this error, try `rustc --explain E0723`.
index 6462d736ad194ac5524c7b7eac7f03d9e9809e44..0c8af5a199aa0179c395ad3e0a46fae5ad0cb8be 100644 (file)
@@ -12,5 +12,5 @@ fn main() {}
 const unsafe fn no_union() {
     union Foo { x: (), y: () }
     Foo { x: () }.y
-    //~^ accessing union fields is unstable
+    //~^ unions in const fn
 }
index 427ecff5c6d1a6b2486c42313b3184dc4b6ebc81..322052c28fab13b1ef95e2f1d045e58ebd332e9c 100644 (file)
@@ -25,16 +25,15 @@ LL | const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static u
    = note: see issue #51911 <https://github.com/rust-lang/rust/issues/51911> for more information
    = help: add `#![feature(const_raw_ptr_deref)]` to the crate attributes to enable
 
-error[E0723]: accessing union fields is unstable
+error[E0658]: unions in const fn are unstable
   --> $DIR/min_const_fn_unsafe_bad.rs:14:5
    |
 LL |     Foo { x: () }.y
    |     ^^^^^^^^^^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = note: see issue #51909 <https://github.com/rust-lang/rust/issues/51909> for more information
+   = help: add `#![feature(const_fn_union)]` to the crate attributes to enable
 
 error: aborting due to 4 previous errors
 
-Some errors have detailed explanations: E0658, E0723.
-For more information about an error, try `rustc --explain E0658`.
+For more information about this error, try `rustc --explain E0658`.
index 12b41ee2b0d6a2454bf739b684030ad68ab1cabf..902ed435e31bc05c252ede664c0d3bc0e09ec137 100644 (file)
@@ -13,7 +13,7 @@
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
 // can't call non-min_const_fn
-const unsafe fn bar() -> u32 { unsafe { foo() } } //~ ERROR can only call other `const fn`
+const unsafe fn bar() -> u32 { unsafe { foo() } } //~ ERROR not yet stable as a const fn
 
 #[unstable(feature = "rust1", issue = "none")]
 const unsafe fn foo2() -> u32 { 42 }
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
 // can't call non-min_const_fn
-const unsafe fn bar2() -> u32 { unsafe { foo2() } } //~ ERROR can only call other `const fn`
+const unsafe fn bar2() -> u32 { unsafe { foo2() } } //~ ERROR not yet stable as a const fn
 
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
 // conformity is required, even with `const_fn` feature gate
-const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 } //~ ERROR only int, `bool` and `char` op
+const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }
+//~^ ERROR const-stable function cannot use `#[feature(const_fn)]`
 
 // check whether this function cannot be called even with the feature gate active
 #[unstable(feature = "foo2", issue = "none")]
@@ -36,6 +37,6 @@
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
 // can't call non-min_const_fn
 const unsafe fn bar2_gated() -> u32 { unsafe { foo2_gated() } }
-//~^ ERROR can only call other `const fn`
+//~^ ERROR not yet stable as a const fn
 
 fn main() {}
index c5ff340dfc6b759a2003bf82466439d924a33d74..2741a86440487c9849b372f298287e245bc5c6eb 100644 (file)
@@ -1,39 +1,38 @@
-error[E0723]: can only call other `const fn` within a `const fn`, but `foo` is not stable as `const fn`
+error: `foo` is not yet stable as a const fn
   --> $DIR/min_const_unsafe_fn_libstd_stability.rs:16:41
    |
 LL | const unsafe fn bar() -> u32 { unsafe { foo() } }
    |                                         ^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = help: Const-stable functions can only call other const-stable functions
 
-error[E0723]: can only call other `const fn` within a `const fn`, but `foo2` is not stable as `const fn`
+error: `foo2` is not yet stable as a const fn
   --> $DIR/min_const_unsafe_fn_libstd_stability.rs:24:42
    |
 LL | const unsafe fn bar2() -> u32 { unsafe { foo2() } }
    |                                          ^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = help: Const-stable functions can only call other const-stable functions
 
-error[E0723]: only int, `bool` and `char` operations are stable in const fn
+error: const-stable function cannot use `#[feature(const_fn)]`
   --> $DIR/min_const_unsafe_fn_libstd_stability.rs:29:33
    |
 LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }
    |                                 ^^^^^^^^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = note: otherwise `#[allow_internal_unstable]` can be used to bypass stability checks
+help: if it is not part of the public API, make this function unstably const
+   |
+LL | #[rustc_const_unstable(feature = "...", issue = "...")]
+   |
 
-error[E0723]: can only call other `const fn` within a `const fn`, but `foo2_gated` is not stable as `const fn`
-  --> $DIR/min_const_unsafe_fn_libstd_stability.rs:38:48
+error: `foo2_gated` is not yet stable as a const fn
+  --> $DIR/min_const_unsafe_fn_libstd_stability.rs:39:48
    |
 LL | const unsafe fn bar2_gated() -> u32 { unsafe { foo2_gated() } }
    |                                                ^^^^^^^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = help: Const-stable functions can only call other const-stable functions
 
 error: aborting due to 4 previous errors
 
-For more information about this error, try `rustc --explain E0723`.
index 44a62094987373d2787b273d2a853d34f2749892..d17dcb281153c41fffcef1fa2269edca036632ca 100644 (file)
@@ -13,7 +13,7 @@ const fn foo() -> u32 { 42 }
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
 // can't call non-min_const_fn
-const unsafe fn bar() -> u32 { foo() } //~ ERROR can only call other `const fn`
+const unsafe fn bar() -> u32 { foo() } //~ ERROR not yet stable as a const fn
 
 #[unstable(feature = "rust1", issue = "none")]
 const fn foo2() -> u32 { 42 }
@@ -21,7 +21,7 @@ const fn foo2() -> u32 { 42 }
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
 // can't call non-min_const_fn
-const unsafe fn bar2() -> u32 { foo2() } //~ ERROR can only call other `const fn`
+const unsafe fn bar2() -> u32 { foo2() } //~ ERROR not yet stable as a const fn
 
 // check whether this function cannot be called even with the feature gate active
 #[unstable(feature = "foo2", issue = "none")]
@@ -30,6 +30,6 @@ const fn foo2_gated() -> u32 { 42 }
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
 // can't call non-min_const_fn
-const unsafe fn bar2_gated() -> u32 { foo2_gated() } //~ ERROR can only call other `const fn`
+const unsafe fn bar2_gated() -> u32 { foo2_gated() } //~ ERROR not yet stable as a const fn
 
 fn main() {}
index 31ad12c95511365a4a9cf5ab274dbe610eb2d99b..891c34a888a700b95f6133670a9dd06c01746c9d 100644 (file)
@@ -1,30 +1,26 @@
-error[E0723]: can only call other `const fn` within a `const fn`, but `foo` is not stable as `const fn`
+error: `foo` is not yet stable as a const fn
   --> $DIR/min_const_unsafe_fn_libstd_stability2.rs:16:32
    |
 LL | const unsafe fn bar() -> u32 { foo() }
    |                                ^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = help: Const-stable functions can only call other const-stable functions
 
-error[E0723]: can only call other `const fn` within a `const fn`, but `foo2` is not stable as `const fn`
+error: `foo2` is not yet stable as a const fn
   --> $DIR/min_const_unsafe_fn_libstd_stability2.rs:24:33
    |
 LL | const unsafe fn bar2() -> u32 { foo2() }
    |                                 ^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = help: Const-stable functions can only call other const-stable functions
 
-error[E0723]: can only call other `const fn` within a `const fn`, but `foo2_gated` is not stable as `const fn`
+error: `foo2_gated` is not yet stable as a const fn
   --> $DIR/min_const_unsafe_fn_libstd_stability2.rs:33:39
    |
 LL | const unsafe fn bar2_gated() -> u32 { foo2_gated() }
    |                                       ^^^^^^^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = help: Const-stable functions can only call other const-stable functions
 
 error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0723`.
index eb250081d6a72c37af4438f5584a7bd8bc4cf375..93b67fd7b1428a710bfe9dd6efd678107fae0c0a 100644 (file)
@@ -12,6 +12,16 @@ LL | static VAL: () = call_rust_fn(unsafe { std::mem::transmute(c_fn as extern "
 
 warning: skipping const checks
    |
+help: skipping check for `const_fn` feature
+  --> $DIR/abi-mismatch.rs:9:23
+   |
+LL | const fn call_rust_fn(my_fn: extern "Rust" fn()) {
+   |                       ^^^^^
+help: skipping check for `const_fn` feature
+  --> $DIR/abi-mismatch.rs:10:5
+   |
+LL |     my_fn();
+   |     ^^^^^
 help: skipping check that does not even have a feature gate
   --> $DIR/abi-mismatch.rs:10:5
    |
index 67d9f6baca5b447a440c09036d63474d3c5beb5e..af6bc2d85fdd68770ecec1fd5167087415837af3 100644 (file)
@@ -4,7 +4,7 @@
 
 pub const fn dangling_slice<T>() -> NonNull<[T]> {
     NonNull::<[T; 0]>::dangling()
-    //~^ ERROR: unsizing casts are only allowed for references right now
+    //~^ ERROR: unsizing casts to types besides slices
 }
 
 fn main() {}
index 6575355daadd7fb34a83abb08529854ae9beeefd..dc08ccd02b646533d17ebdda9e86b4761b64cb9d 100644 (file)
@@ -1,4 +1,4 @@
-error[E0723]: unsizing casts are only allowed for references right now
+error[E0723]: unsizing casts to types besides slices are not allowed in const fn
   --> $DIR/unsizing-cast-non-null.rs:6:5
    |
 LL |     NonNull::<[T; 0]>::dangling()
index 29d3dc18fa7cc06bdfd1ca168d78073850b9e70b..43951c6854b1aa820cd0f2f857b693eb6d318edc 100644 (file)
@@ -6,6 +6,7 @@
 #![stable(feature = "core", since = "1.6.0")]
 #![feature(rustc_const_unstable)]
 #![feature(staged_api)]
+#![feature(const_fn)]
 
 enum Opt<T> {
     Some(T),
index be797cae7ca97cfc65320645c77be589f834461c..928605356a16e3d94f07d1215c509599b1ece247 100644 (file)
@@ -1,11 +1,11 @@
 error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-  --> $DIR/unstable-const-fn-in-libcore.rs:23:26
+  --> $DIR/unstable-const-fn-in-libcore.rs:24:26
    |
 LL |             Opt::None => f(),
    |                          ^^^
 
 error[E0493]: destructors cannot be evaluated at compile-time
-  --> $DIR/unstable-const-fn-in-libcore.rs:18:53
+  --> $DIR/unstable-const-fn-in-libcore.rs:19:53
    |
 LL |     const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
    |                                                     ^ constant functions cannot evaluate destructors
@@ -14,7 +14,7 @@ LL |     }
    |     - value is dropped here
 
 error[E0493]: destructors cannot be evaluated at compile-time
-  --> $DIR/unstable-const-fn-in-libcore.rs:18:47
+  --> $DIR/unstable-const-fn-in-libcore.rs:19:47
    |
 LL |     const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
    |                                               ^^^^ constant functions cannot evaluate destructors
index c327667f4cdc7344f1ced7f0fbf8ac6c908c7c7f..6d3fc3ce2f171440d156456ece8ece25b85f6a68 100644 (file)
@@ -12,6 +12,7 @@ const fn ff3() {} // OK.
     extern "C" fn ff4() {} // OK.
     const async unsafe extern "C" fn ff5() {} // OK.
     //~^ ERROR functions cannot be both `const` and `async`
+    //~| ERROR `from_generator` is not yet stable as a const fn
 
     trait X {
         async fn ft1(); //~ ERROR functions in traits cannot be declared `async`
@@ -34,6 +35,7 @@ extern "C" fn ft4() {}
         const async unsafe extern "C" fn ft5() {}
         //~^ ERROR functions in traits cannot be declared `async`
         //~| ERROR functions in traits cannot be declared const
+        //~| ERROR `from_generator` is not yet stable as a const fn
         //~| ERROR method `ft5` has an incompatible type for trait
         //~| ERROR functions cannot be both `const` and `async`
     }
@@ -45,6 +47,7 @@ const fn fi3() {} // OK.
         extern "C" fn fi4() {} // OK.
         const async unsafe extern "C" fn fi5() {}
         //~^ ERROR functions cannot be both `const` and `async`
+        //~| ERROR `from_generator` is not yet stable as a const fn
     }
 
     extern {
index 4193b3ee695bcfd8ed1d4aba67057af38c5c9c46..f1e21884040f0e568fe6b9c54b2867838a6ef729 100644 (file)
@@ -8,7 +8,7 @@ LL |     const async unsafe extern "C" fn ff5() {} // OK.
    |     `const` because of this
 
 error[E0706]: functions in traits cannot be declared `async`
-  --> $DIR/fn-header-semantic-fail.rs:17:9
+  --> $DIR/fn-header-semantic-fail.rs:18:9
    |
 LL |         async fn ft1();
    |         -----^^^^^^^^^^
@@ -19,19 +19,19 @@ LL |         async fn ft1();
    = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
 
 error[E0379]: functions in traits cannot be declared const
-  --> $DIR/fn-header-semantic-fail.rs:19:9
+  --> $DIR/fn-header-semantic-fail.rs:20:9
    |
 LL |         const fn ft3();
    |         ^^^^^ functions in traits cannot be const
 
 error[E0379]: functions in traits cannot be declared const
-  --> $DIR/fn-header-semantic-fail.rs:21:9
+  --> $DIR/fn-header-semantic-fail.rs:22:9
    |
 LL |         const async unsafe extern "C" fn ft5();
    |         ^^^^^ functions in traits cannot be const
 
 error[E0706]: functions in traits cannot be declared `async`
-  --> $DIR/fn-header-semantic-fail.rs:21:9
+  --> $DIR/fn-header-semantic-fail.rs:22:9
    |
 LL |         const async unsafe extern "C" fn ft5();
    |         ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -42,7 +42,7 @@ LL |         const async unsafe extern "C" fn ft5();
    = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
 
 error: functions cannot be both `const` and `async`
-  --> $DIR/fn-header-semantic-fail.rs:21:9
+  --> $DIR/fn-header-semantic-fail.rs:22:9
    |
 LL |         const async unsafe extern "C" fn ft5();
    |         ^^^^^-^^^^^----------------------------
@@ -51,7 +51,7 @@ LL |         const async unsafe extern "C" fn ft5();
    |         `const` because of this
 
 error[E0706]: functions in traits cannot be declared `async`
-  --> $DIR/fn-header-semantic-fail.rs:29:9
+  --> $DIR/fn-header-semantic-fail.rs:30:9
    |
 LL |         async fn ft1() {}
    |         -----^^^^^^^^^^^^
@@ -62,19 +62,19 @@ LL |         async fn ft1() {}
    = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
 
 error[E0379]: functions in traits cannot be declared const
-  --> $DIR/fn-header-semantic-fail.rs:32:9
+  --> $DIR/fn-header-semantic-fail.rs:33:9
    |
 LL |         const fn ft3() {}
    |         ^^^^^ functions in traits cannot be const
 
 error[E0379]: functions in traits cannot be declared const
-  --> $DIR/fn-header-semantic-fail.rs:34:9
+  --> $DIR/fn-header-semantic-fail.rs:35:9
    |
 LL |         const async unsafe extern "C" fn ft5() {}
    |         ^^^^^ functions in traits cannot be const
 
 error[E0706]: functions in traits cannot be declared `async`
-  --> $DIR/fn-header-semantic-fail.rs:34:9
+  --> $DIR/fn-header-semantic-fail.rs:35:9
    |
 LL |         const async unsafe extern "C" fn ft5() {}
    |         ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -85,7 +85,7 @@ LL |         const async unsafe extern "C" fn ft5() {}
    = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
 
 error: functions cannot be both `const` and `async`
-  --> $DIR/fn-header-semantic-fail.rs:34:9
+  --> $DIR/fn-header-semantic-fail.rs:35:9
    |
 LL |         const async unsafe extern "C" fn ft5() {}
    |         ^^^^^-^^^^^------------------------------
@@ -94,7 +94,7 @@ LL |         const async unsafe extern "C" fn ft5() {}
    |         `const` because of this
 
 error: functions cannot be both `const` and `async`
-  --> $DIR/fn-header-semantic-fail.rs:46:9
+  --> $DIR/fn-header-semantic-fail.rs:48:9
    |
 LL |         const async unsafe extern "C" fn fi5() {}
    |         ^^^^^-^^^^^------------------------------
@@ -103,7 +103,7 @@ LL |         const async unsafe extern "C" fn fi5() {}
    |         `const` because of this
 
 error: functions in `extern` blocks cannot have qualifiers
-  --> $DIR/fn-header-semantic-fail.rs:51:18
+  --> $DIR/fn-header-semantic-fail.rs:54:18
    |
 LL |     extern {
    |     ------ in this `extern` block
@@ -113,7 +113,7 @@ LL |         async fn fe1();
    |         help: remove the qualifiers: `fn`
 
 error: functions in `extern` blocks cannot have qualifiers
-  --> $DIR/fn-header-semantic-fail.rs:52:19
+  --> $DIR/fn-header-semantic-fail.rs:55:19
    |
 LL |     extern {
    |     ------ in this `extern` block
@@ -124,7 +124,7 @@ LL |         unsafe fn fe2();
    |         help: remove the qualifiers: `fn`
 
 error: functions in `extern` blocks cannot have qualifiers
-  --> $DIR/fn-header-semantic-fail.rs:53:18
+  --> $DIR/fn-header-semantic-fail.rs:56:18
    |
 LL |     extern {
    |     ------ in this `extern` block
@@ -135,7 +135,7 @@ LL |         const fn fe3();
    |         help: remove the qualifiers: `fn`
 
 error: functions in `extern` blocks cannot have qualifiers
-  --> $DIR/fn-header-semantic-fail.rs:54:23
+  --> $DIR/fn-header-semantic-fail.rs:57:23
    |
 LL |     extern {
    |     ------ in this `extern` block
@@ -146,7 +146,7 @@ LL |         extern "C" fn fe4();
    |         help: remove the qualifiers: `fn`
 
 error: functions in `extern` blocks cannot have qualifiers
-  --> $DIR/fn-header-semantic-fail.rs:55:42
+  --> $DIR/fn-header-semantic-fail.rs:58:42
    |
 LL |     extern {
    |     ------ in this `extern` block
@@ -157,7 +157,7 @@ LL |         const async unsafe extern "C" fn fe5();
    |         help: remove the qualifiers: `fn`
 
 error: functions cannot be both `const` and `async`
-  --> $DIR/fn-header-semantic-fail.rs:55:9
+  --> $DIR/fn-header-semantic-fail.rs:58:9
    |
 LL |         const async unsafe extern "C" fn fe5();
    |         ^^^^^-^^^^^----------------------------
@@ -165,8 +165,16 @@ LL |         const async unsafe extern "C" fn fe5();
    |         |     `async` because of this
    |         `const` because of this
 
+error: `from_generator` is not yet stable as a const fn
+  --> $DIR/fn-header-semantic-fail.rs:13:44
+   |
+LL |     const async unsafe extern "C" fn ff5() {} // OK.
+   |                                            ^^
+   |
+   = help: add `#![feature(gen_future)]` to the crate attributes to enable
+
 error[E0053]: method `ft1` has an incompatible type for trait
-  --> $DIR/fn-header-semantic-fail.rs:29:24
+  --> $DIR/fn-header-semantic-fail.rs:30:24
    |
 LL |         async fn ft1();
    |                       - type in trait
@@ -181,7 +189,7 @@ LL |         async fn ft1() {}
               found fn pointer `fn() -> impl Future`
 
 error[E0053]: method `ft5` has an incompatible type for trait
-  --> $DIR/fn-header-semantic-fail.rs:34:48
+  --> $DIR/fn-header-semantic-fail.rs:35:48
    |
 LL |         const async unsafe extern "C" fn ft5();
    |                                               - type in trait
@@ -195,7 +203,23 @@ LL |         const async unsafe extern "C" fn ft5() {}
    = note: expected fn pointer `unsafe extern "C" fn()`
               found fn pointer `unsafe extern "C" fn() -> impl Future`
 
-error: aborting due to 20 previous errors
+error: `from_generator` is not yet stable as a const fn
+  --> $DIR/fn-header-semantic-fail.rs:35:48
+   |
+LL |         const async unsafe extern "C" fn ft5() {}
+   |                                                ^^
+   |
+   = help: add `#![feature(gen_future)]` to the crate attributes to enable
+
+error: `from_generator` is not yet stable as a const fn
+  --> $DIR/fn-header-semantic-fail.rs:48:48
+   |
+LL |         const async unsafe extern "C" fn fi5() {}
+   |                                                ^^
+   |
+   = help: add `#![feature(gen_future)]` to the crate attributes to enable
+
+error: aborting due to 23 previous errors
 
 Some errors have detailed explanations: E0053, E0379, E0706.
 For more information about an error, try `rustc --explain E0053`.
index 3278f35bad2b227df7076f0d734798c9f004fcc9..fc85e98ef532689d924d1ec0741c7458935cde7e 100644 (file)
@@ -10,7 +10,7 @@ fn non_const() {}
 
 impl const T for S {
     fn foo() { non_const() }
-    //~^ ERROR can only call other `const fn`
+    //~^ ERROR calls in constant functions
 }
 
 fn main() {}
index b50dd03a861385ae2b576ca833645e6b2519f614..c6c78c7d1e89564873908c5bb6cff24f0334bd01 100644 (file)
@@ -1,12 +1,9 @@
-error[E0723]: can only call other `const fn` within a `const fn`, but `non_const` is not stable as `const fn`
+error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
   --> $DIR/const-check-fns-in-const-impl.rs:12:16
    |
 LL |     fn foo() { non_const() }
    |                ^^^^^^^^^^^
-   |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0723`.
+For more information about this error, try `rustc --explain E0015`.
index 3994bd97c308e125dd0ea73cc72ed3b950bdd289..58041454d5901058fa3cc093586d8b9f48cc852d 100644 (file)
@@ -1,5 +1,5 @@
 error: fatal error triggered by #[rustc_error]
-  --> $DIR/feature-gate.rs:16:1
+  --> $DIR/feature-gate.rs:17:1
    |
 LL | fn main() {}
    | ^^^^^^^^^
index d600b53e448750bfb6a76cec02e8d9f5ac575b36..3506237d1f1d58b8f5450a062cbc650b7eb0a01a 100644 (file)
@@ -4,6 +4,7 @@
 #![cfg_attr(gated, feature(const_trait_bound_opt_out))]
 #![allow(incomplete_features)]
 #![feature(rustc_attrs)]
+#![feature(const_fn)]
 
 trait T {
     const CONST: i32;
index a1e1c3249af3670f302a20e38fad77a23c34261a..8ae8b8868ddedaccb09b96b8af1d45e9cf28bf5b 100644 (file)
@@ -1,5 +1,5 @@
 error[E0658]: `?const` on trait bounds is experimental
-  --> $DIR/feature-gate.rs:12:29
+  --> $DIR/feature-gate.rs:13:29
    |
 LL | const fn get_assoc_const<S: ?const T>() -> i32 { <S as T>::CONST }
    |                             ^^^^^^
index 03a6fb51503b50c31048dca48cbb6a913353fb91..454fde34a2cdca25aee5f58945b45ba4c88d204a 100644 (file)
@@ -30,7 +30,7 @@ fn add(self, rhs: Self) -> Self {
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
 pub const fn foo() -> Int {
     Int(1i32) + Int(2i32)
-    //~^ ERROR can only call other `const fn` within a `const fn`
+    //~^ ERROR not yet stable as a const fn
 }
 
 // ok
index ddef7a3aafc937c6e9124a8557731f5980fc8a1a..54d7cfd5d797390023baa754edbe2faea4f13298 100644 (file)
@@ -6,18 +6,14 @@ LL | |
 LL | |         Int(self.0 - rhs.0)
 LL | |     }
    | |_____^
-   |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
 
-error[E0723]: can only call other `const fn` within a `const fn`, but `<Int as Add>::add` is not stable as `const fn`
+error: `<Int as Add>::add` is not yet stable as a const fn
   --> $DIR/stability.rs:32:5
    |
 LL |     Int(1i32) + Int(2i32)
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
-   = help: add `#![feature(const_fn)]` to the crate attributes to enable
+   = help: Const-stable functions can only call other const-stable functions
 
 error: aborting due to 2 previous errors
 
index 788f49f743cda3a667987939dd2d61be5f5dd9b1..65e0d79308ca3e04eb0295b4956bee0f7760c2fe 100644 (file)
@@ -8,13 +8,13 @@ fn main() {
 
 const fn foo() -> NonZero<u32> {
     let mut x = unsafe { NonZero(1) };
-    let y = &mut x.0; //~ ERROR references in const fn are unstable
+    let y = &mut x.0; //~ ERROR mutable references
     //~^ ERROR mutation of layout constrained field is unsafe
     unsafe { NonZero(1) }
 }
 
 const fn bar() -> NonZero<u32> {
     let mut x = unsafe { NonZero(1) };
-    let y = unsafe { &mut x.0 }; //~ ERROR mutable references in const fn are unstable
+    let y = unsafe { &mut x.0 }; //~ ERROR mutable references
     unsafe { NonZero(1) }
 }