summaryrefslogtreecommitdiffstats
path: root/src/test/ui/panics/panic-2021.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/panics/panic-2021.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/panics/panic-2021.rs b/src/test/ui/panics/panic-2021.rs
new file mode 100644
index 000000000..e606612e1
--- /dev/null
+++ b/src/test/ui/panics/panic-2021.rs
@@ -0,0 +1,9 @@
+// edition:2021
+
+fn main() {
+ panic!(123); //~ ERROR: format argument must be a string literal
+ panic!("{}"); //~ ERROR: 1 positional argument in format string
+ core::panic!("{}"); //~ ERROR: 1 positional argument in format string
+ assert!(false, 123); //~ ERROR: format argument must be a string literal
+ assert!(false, "{}"); //~ ERROR: 1 positional argument in format string
+}