summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/format.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const-eval/format.rs')
-rw-r--r--tests/ui/consts/const-eval/format.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/consts/const-eval/format.rs b/tests/ui/consts/const-eval/format.rs
new file mode 100644
index 000000000..0d8b7c12d
--- /dev/null
+++ b/tests/ui/consts/const-eval/format.rs
@@ -0,0 +1,13 @@
+const fn failure() {
+ panic!("{:?}", 0);
+ //~^ ERROR cannot call non-const formatting macro in constant functions
+}
+
+const fn print() {
+ println!("{:?}", 0);
+ //~^ ERROR cannot call non-const formatting macro in constant functions
+ //~| ERROR `Arguments::<'a>::new_v1` is not yet stable as a const fn
+ //~| ERROR cannot call non-const fn `_print` in constant functions
+}
+
+fn main() {}