From bb78426ca8f12f467e4d3bb38e82c0d3b6209e61 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Mon, 13 Aug 2018 13:48:47 +0200 Subject: Allow panicking with string literal messages inside constants --- src/libsyntax/feature_gate.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libsyntax') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 71ad118ed8e..4a819814d81 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -224,6 +224,9 @@ declare_features! ( // Allows comparing raw pointers during const eval (active, const_compare_raw_pointers, "1.27.0", Some(53020), None), + // Allows panicking during const eval (produces compile-time errors) + (active, const_panic, "1.29.0", Some(51999), None), + // Allows using #[prelude_import] on glob `use` items. // // rustc internal -- cgit 1.4.1-3-g733a5 From bd6ae6a6d10f3ebe51d0a7a8d7ef342a65f68ff4 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Mon, 13 Aug 2018 14:27:29 +0200 Subject: Reexpose stability hole in the presence of feature gates --- src/libsyntax/feature_gate.rs | 2 +- src/test/ui/const-eval/const_panic.rs | 22 ------------- src/test/ui/const-eval/const_panic.stderr | 33 ------------------- src/test/ui/const-eval/const_panic_libcore.rs | 22 ------------- src/test/ui/const-eval/const_panic_libcore.stderr | 33 ------------------- src/test/ui/const-eval/const_panic_libcore_main.rs | 35 -------------------- .../ui/const-eval/const_panic_libcore_main.stderr | 33 ------------------- src/test/ui/const-eval/feature-gate-const_panic.rs | 20 ------------ .../ui/const-eval/feature-gate-const_panic.stderr | 30 ------------------ src/test/ui/consts/const-eval/const_panic.rs | 22 +++++++++++++ src/test/ui/consts/const-eval/const_panic.stderr | 33 +++++++++++++++++++ .../ui/consts/const-eval/const_panic_libcore.rs | 22 +++++++++++++ .../consts/const-eval/const_panic_libcore.stderr | 33 +++++++++++++++++++ .../consts/const-eval/const_panic_libcore_main.rs | 37 ++++++++++++++++++++++ .../const-eval/const_panic_libcore_main.stderr | 33 +++++++++++++++++++ .../consts/const-eval/feature-gate-const_panic.rs | 20 ++++++++++++ .../const-eval/feature-gate-const_panic.stderr | 30 ++++++++++++++++++ 17 files changed, 231 insertions(+), 229 deletions(-) delete mode 100644 src/test/ui/const-eval/const_panic.rs delete mode 100644 src/test/ui/const-eval/const_panic.stderr delete mode 100644 src/test/ui/const-eval/const_panic_libcore.rs delete mode 100644 src/test/ui/const-eval/const_panic_libcore.stderr delete mode 100644 src/test/ui/const-eval/const_panic_libcore_main.rs delete mode 100644 src/test/ui/const-eval/const_panic_libcore_main.stderr delete mode 100644 src/test/ui/const-eval/feature-gate-const_panic.rs delete mode 100644 src/test/ui/const-eval/feature-gate-const_panic.stderr create mode 100644 src/test/ui/consts/const-eval/const_panic.rs create mode 100644 src/test/ui/consts/const-eval/const_panic.stderr create mode 100644 src/test/ui/consts/const-eval/const_panic_libcore.rs create mode 100644 src/test/ui/consts/const-eval/const_panic_libcore.stderr create mode 100644 src/test/ui/consts/const-eval/const_panic_libcore_main.rs create mode 100644 src/test/ui/consts/const-eval/const_panic_libcore_main.stderr create mode 100644 src/test/ui/consts/const-eval/feature-gate-const_panic.rs create mode 100644 src/test/ui/consts/const-eval/feature-gate-const_panic.stderr (limited to 'src/libsyntax') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 4a819814d81..6c33c4c245b 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -225,7 +225,7 @@ declare_features! ( (active, const_compare_raw_pointers, "1.27.0", Some(53020), None), // Allows panicking during const eval (produces compile-time errors) - (active, const_panic, "1.29.0", Some(51999), None), + (active, const_panic, "1.30.0", Some(51999), None), // Allows using #[prelude_import] on glob `use` items. // diff --git a/src/test/ui/const-eval/const_panic.rs b/src/test/ui/const-eval/const_panic.rs deleted file mode 100644 index f2170f509eb..00000000000 --- a/src/test/ui/const-eval/const_panic.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2018 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. - -#![feature(const_panic)] - -fn main() {} - -const Z: () = panic!("cheese"); -//~^ ERROR this constant cannot be used - -const Y: () = unreachable!(); -//~^ ERROR this constant cannot be used - -const X: () = unimplemented!(); -//~^ ERROR this constant cannot be used diff --git a/src/test/ui/const-eval/const_panic.stderr b/src/test/ui/const-eval/const_panic.stderr deleted file mode 100644 index c11146f4882..00000000000 --- a/src/test/ui/const-eval/const_panic.stderr +++ /dev/null @@ -1,33 +0,0 @@ -error: this constant cannot be used - --> $DIR/const_panic.rs:15:1 - | -LL | const Z: () = panic!("cheese"); - | ^^^^^^^^^^^^^^----------------^ - | | - | the evaluated program panicked at 'cheese', $DIR/const_panic.rs:15:15 - | - = note: #[deny(const_err)] on by default - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -error: this constant cannot be used - --> $DIR/const_panic.rs:18:1 - | -LL | const Y: () = unreachable!(); - | ^^^^^^^^^^^^^^--------------^ - | | - | the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic.rs:18:15 - | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -error: this constant cannot be used - --> $DIR/const_panic.rs:21:1 - | -LL | const X: () = unimplemented!(); - | ^^^^^^^^^^^^^^----------------^ - | | - | the evaluated program panicked at 'not yet implemented', $DIR/const_panic.rs:21:15 - | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -error: aborting due to 3 previous errors - diff --git a/src/test/ui/const-eval/const_panic_libcore.rs b/src/test/ui/const-eval/const_panic_libcore.rs deleted file mode 100644 index 59aeca18129..00000000000 --- a/src/test/ui/const-eval/const_panic_libcore.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2018 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. - -#![no_std] -#![crate_type = "lib"] -#![feature(const_panic)] - -const Z: () = panic!("cheese"); -//~^ ERROR this constant cannot be used - -const Y: () = unreachable!(); -//~^ ERROR this constant cannot be used - -const X: () = unimplemented!(); -//~^ ERROR this constant cannot be used diff --git a/src/test/ui/const-eval/const_panic_libcore.stderr b/src/test/ui/const-eval/const_panic_libcore.stderr deleted file mode 100644 index 45f2ee7744e..00000000000 --- a/src/test/ui/const-eval/const_panic_libcore.stderr +++ /dev/null @@ -1,33 +0,0 @@ -error: this constant cannot be used - --> $DIR/const_panic_libcore.rs:15:1 - | -LL | const Z: () = panic!("cheese"); - | ^^^^^^^^^^^^^^----------------^ - | | - | the evaluated program panicked at 'cheese', $DIR/const_panic_libcore.rs:15:15 - | - = note: #[deny(const_err)] on by default - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -error: this constant cannot be used - --> $DIR/const_panic_libcore.rs:18:1 - | -LL | const Y: () = unreachable!(); - | ^^^^^^^^^^^^^^--------------^ - | | - | the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_libcore.rs:18:15 - | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -error: this constant cannot be used - --> $DIR/const_panic_libcore.rs:21:1 - | -LL | const X: () = unimplemented!(); - | ^^^^^^^^^^^^^^----------------^ - | | - | the evaluated program panicked at 'not yet implemented', $DIR/const_panic_libcore.rs:21:15 - | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -error: aborting due to 3 previous errors - diff --git a/src/test/ui/const-eval/const_panic_libcore_main.rs b/src/test/ui/const-eval/const_panic_libcore_main.rs deleted file mode 100644 index bbbe827a8ef..00000000000 --- a/src/test/ui/const-eval/const_panic_libcore_main.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2018 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. - -#![crate_type = "bin"] -#![feature(lang_items)] -#![feature(panic_implementation)] -#![feature(const_panic)] -#![no_main] -#![no_std] - -use core::panic::PanicInfo; - -const Z: () = panic!("cheese"); -//~^ ERROR this constant cannot be used - -const Y: () = unreachable!(); -//~^ ERROR this constant cannot be used - -const X: () = unimplemented!(); -//~^ ERROR this constant cannot be used - -#[lang = "eh_personality"] -fn eh() {} - -#[panic_implementation] -fn panic(_info: &PanicInfo) -> ! { - loop {} -} diff --git a/src/test/ui/const-eval/const_panic_libcore_main.stderr b/src/test/ui/const-eval/const_panic_libcore_main.stderr deleted file mode 100644 index 7cb9f51c427..00000000000 --- a/src/test/ui/const-eval/const_panic_libcore_main.stderr +++ /dev/null @@ -1,33 +0,0 @@ -error: this constant cannot be used - --> $DIR/const_panic_libcore_main.rs:20:1 - | -LL | const Z: () = panic!("cheese"); - | ^^^^^^^^^^^^^^----------------^ - | | - | the evaluated program panicked at 'cheese', $DIR/const_panic_libcore_main.rs:20:15 - | - = note: #[deny(const_err)] on by default - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -error: this constant cannot be used - --> $DIR/const_panic_libcore_main.rs:23:1 - | -LL | const Y: () = unreachable!(); - | ^^^^^^^^^^^^^^--------------^ - | | - | the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_libcore_main.rs:23:15 - | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -error: this constant cannot be used - --> $DIR/const_panic_libcore_main.rs:26:1 - | -LL | const X: () = unimplemented!(); - | ^^^^^^^^^^^^^^----------------^ - | | - | the evaluated program panicked at 'not yet implemented', $DIR/const_panic_libcore_main.rs:26:15 - | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -error: aborting due to 3 previous errors - diff --git a/src/test/ui/const-eval/feature-gate-const_panic.rs b/src/test/ui/const-eval/feature-gate-const_panic.rs deleted file mode 100644 index 26eb95d9c66..00000000000 --- a/src/test/ui/const-eval/feature-gate-const_panic.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2018 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. - -fn main() {} - -const Z: () = panic!("cheese"); -//~^ ERROR panicking in constants is unstable - -const Y: () = unreachable!(); -//~^ ERROR panicking in constants is unstable - -const X: () = unimplemented!(); -//~^ ERROR panicking in constants is unstable diff --git a/src/test/ui/const-eval/feature-gate-const_panic.stderr b/src/test/ui/const-eval/feature-gate-const_panic.stderr deleted file mode 100644 index f4d05edd04a..00000000000 --- a/src/test/ui/const-eval/feature-gate-const_panic.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error[E0658]: panicking in constants is unstable (see issue #51999) - --> $DIR/feature-gate-const_panic.rs:13:15 - | -LL | const Z: () = panic!("cheese"); - | ^^^^^^^^^^^^^^^^ - | - = help: add #![feature(const_panic)] to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -error[E0658]: panicking in constants is unstable (see issue #51999) - --> $DIR/feature-gate-const_panic.rs:19:15 - | -LL | const X: () = unimplemented!(); - | ^^^^^^^^^^^^^^^^ - | - = help: add #![feature(const_panic)] to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -error[E0658]: panicking in constants is unstable (see issue #51999) - --> $DIR/feature-gate-const_panic.rs:16:15 - | -LL | const Y: () = unreachable!(); - | ^^^^^^^^^^^^^^ - | - = help: add #![feature(const_panic)] to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/consts/const-eval/const_panic.rs b/src/test/ui/consts/const-eval/const_panic.rs new file mode 100644 index 00000000000..f2170f509eb --- /dev/null +++ b/src/test/ui/consts/const-eval/const_panic.rs @@ -0,0 +1,22 @@ +// Copyright 2018 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. + +#![feature(const_panic)] + +fn main() {} + +const Z: () = panic!("cheese"); +//~^ ERROR this constant cannot be used + +const Y: () = unreachable!(); +//~^ ERROR this constant cannot be used + +const X: () = unimplemented!(); +//~^ ERROR this constant cannot be used diff --git a/src/test/ui/consts/const-eval/const_panic.stderr b/src/test/ui/consts/const-eval/const_panic.stderr new file mode 100644 index 00000000000..c11146f4882 --- /dev/null +++ b/src/test/ui/consts/const-eval/const_panic.stderr @@ -0,0 +1,33 @@ +error: this constant cannot be used + --> $DIR/const_panic.rs:15:1 + | +LL | const Z: () = panic!("cheese"); + | ^^^^^^^^^^^^^^----------------^ + | | + | the evaluated program panicked at 'cheese', $DIR/const_panic.rs:15:15 + | + = note: #[deny(const_err)] on by default + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: this constant cannot be used + --> $DIR/const_panic.rs:18:1 + | +LL | const Y: () = unreachable!(); + | ^^^^^^^^^^^^^^--------------^ + | | + | the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic.rs:18:15 + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: this constant cannot be used + --> $DIR/const_panic.rs:21:1 + | +LL | const X: () = unimplemented!(); + | ^^^^^^^^^^^^^^----------------^ + | | + | the evaluated program panicked at 'not yet implemented', $DIR/const_panic.rs:21:15 + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/consts/const-eval/const_panic_libcore.rs b/src/test/ui/consts/const-eval/const_panic_libcore.rs new file mode 100644 index 00000000000..59aeca18129 --- /dev/null +++ b/src/test/ui/consts/const-eval/const_panic_libcore.rs @@ -0,0 +1,22 @@ +// Copyright 2018 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. + +#![no_std] +#![crate_type = "lib"] +#![feature(const_panic)] + +const Z: () = panic!("cheese"); +//~^ ERROR this constant cannot be used + +const Y: () = unreachable!(); +//~^ ERROR this constant cannot be used + +const X: () = unimplemented!(); +//~^ ERROR this constant cannot be used diff --git a/src/test/ui/consts/const-eval/const_panic_libcore.stderr b/src/test/ui/consts/const-eval/const_panic_libcore.stderr new file mode 100644 index 00000000000..45f2ee7744e --- /dev/null +++ b/src/test/ui/consts/const-eval/const_panic_libcore.stderr @@ -0,0 +1,33 @@ +error: this constant cannot be used + --> $DIR/const_panic_libcore.rs:15:1 + | +LL | const Z: () = panic!("cheese"); + | ^^^^^^^^^^^^^^----------------^ + | | + | the evaluated program panicked at 'cheese', $DIR/const_panic_libcore.rs:15:15 + | + = note: #[deny(const_err)] on by default + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: this constant cannot be used + --> $DIR/const_panic_libcore.rs:18:1 + | +LL | const Y: () = unreachable!(); + | ^^^^^^^^^^^^^^--------------^ + | | + | the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_libcore.rs:18:15 + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: this constant cannot be used + --> $DIR/const_panic_libcore.rs:21:1 + | +LL | const X: () = unimplemented!(); + | ^^^^^^^^^^^^^^----------------^ + | | + | the evaluated program panicked at 'not yet implemented', $DIR/const_panic_libcore.rs:21:15 + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/consts/const-eval/const_panic_libcore_main.rs b/src/test/ui/consts/const-eval/const_panic_libcore_main.rs new file mode 100644 index 00000000000..c66e1fe4bf5 --- /dev/null +++ b/src/test/ui/consts/const-eval/const_panic_libcore_main.rs @@ -0,0 +1,37 @@ +// Copyright 2018 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. + +#![crate_type = "bin"] +#![feature(lang_items)] +#![feature(panic_implementation)] +#![feature(const_panic)] +#![no_main] +#![no_std] + +use core::panic::PanicInfo; + +const Z: () = panic!("cheese"); +//~^ ERROR this constant cannot be used + +const Y: () = unreachable!(); +//~^ ERROR this constant cannot be used + +const X: () = unimplemented!(); +//~^ ERROR this constant cannot be used + +#[lang = "eh_personality"] +fn eh() {} +#[lang = "eh_unwind_resume"] +fn eh_unwind_resume() {} + +#[panic_implementation] +fn panic(_info: &PanicInfo) -> ! { + loop {} +} diff --git a/src/test/ui/consts/const-eval/const_panic_libcore_main.stderr b/src/test/ui/consts/const-eval/const_panic_libcore_main.stderr new file mode 100644 index 00000000000..7cb9f51c427 --- /dev/null +++ b/src/test/ui/consts/const-eval/const_panic_libcore_main.stderr @@ -0,0 +1,33 @@ +error: this constant cannot be used + --> $DIR/const_panic_libcore_main.rs:20:1 + | +LL | const Z: () = panic!("cheese"); + | ^^^^^^^^^^^^^^----------------^ + | | + | the evaluated program panicked at 'cheese', $DIR/const_panic_libcore_main.rs:20:15 + | + = note: #[deny(const_err)] on by default + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: this constant cannot be used + --> $DIR/const_panic_libcore_main.rs:23:1 + | +LL | const Y: () = unreachable!(); + | ^^^^^^^^^^^^^^--------------^ + | | + | the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_libcore_main.rs:23:15 + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: this constant cannot be used + --> $DIR/const_panic_libcore_main.rs:26:1 + | +LL | const X: () = unimplemented!(); + | ^^^^^^^^^^^^^^----------------^ + | | + | the evaluated program panicked at 'not yet implemented', $DIR/const_panic_libcore_main.rs:26:15 + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/consts/const-eval/feature-gate-const_panic.rs b/src/test/ui/consts/const-eval/feature-gate-const_panic.rs new file mode 100644 index 00000000000..26eb95d9c66 --- /dev/null +++ b/src/test/ui/consts/const-eval/feature-gate-const_panic.rs @@ -0,0 +1,20 @@ +// Copyright 2018 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. + +fn main() {} + +const Z: () = panic!("cheese"); +//~^ ERROR panicking in constants is unstable + +const Y: () = unreachable!(); +//~^ ERROR panicking in constants is unstable + +const X: () = unimplemented!(); +//~^ ERROR panicking in constants is unstable diff --git a/src/test/ui/consts/const-eval/feature-gate-const_panic.stderr b/src/test/ui/consts/const-eval/feature-gate-const_panic.stderr new file mode 100644 index 00000000000..f4d05edd04a --- /dev/null +++ b/src/test/ui/consts/const-eval/feature-gate-const_panic.stderr @@ -0,0 +1,30 @@ +error[E0658]: panicking in constants is unstable (see issue #51999) + --> $DIR/feature-gate-const_panic.rs:13:15 + | +LL | const Z: () = panic!("cheese"); + | ^^^^^^^^^^^^^^^^ + | + = help: add #![feature(const_panic)] to the crate attributes to enable + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error[E0658]: panicking in constants is unstable (see issue #51999) + --> $DIR/feature-gate-const_panic.rs:19:15 + | +LL | const X: () = unimplemented!(); + | ^^^^^^^^^^^^^^^^ + | + = help: add #![feature(const_panic)] to the crate attributes to enable + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error[E0658]: panicking in constants is unstable (see issue #51999) + --> $DIR/feature-gate-const_panic.rs:16:15 + | +LL | const Y: () = unreachable!(); + | ^^^^^^^^^^^^^^ + | + = help: add #![feature(const_panic)] to the crate attributes to enable + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0658`. -- cgit 1.4.1-3-g733a5