summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/const_panic_stability.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const-eval/const_panic_stability.rs')
-rw-r--r--tests/ui/consts/const-eval/const_panic_stability.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/consts/const-eval/const_panic_stability.rs b/tests/ui/consts/const-eval/const_panic_stability.rs
new file mode 100644
index 000000000..1aee6f27e
--- /dev/null
+++ b/tests/ui/consts/const-eval/const_panic_stability.rs
@@ -0,0 +1,17 @@
+// revisions: e2018 e2021
+//[e2018] edition:2018
+//[e2021] edition:2021
+//[e2018] check-pass
+#![crate_type = "lib"]
+#![stable(feature = "foo", since = "1.0.0")]
+#![feature(staged_api)]
+
+#[stable(feature = "foo", since = "1.0.0")]
+#[rustc_const_stable(feature = "foo", since = "1.0.0")]
+const fn foo() {
+ assert!(false);
+ assert!(false, "foo");
+ panic!({ "foo" });
+ //[e2018]~^ WARNING panic message is not a string literal
+ //[e2021]~^^ ERROR format argument must be a string literal
+}