about summary refs log tree commit diff
path: root/src/test/ui/fmt/feature-gate-format-args-capture.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/fmt/feature-gate-format-args-capture.rs')
-rw-r--r--src/test/ui/fmt/feature-gate-format-args-capture.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/ui/fmt/feature-gate-format-args-capture.rs b/src/test/ui/fmt/feature-gate-format-args-capture.rs
new file mode 100644
index 00000000000..21af9161091
--- /dev/null
+++ b/src/test/ui/fmt/feature-gate-format-args-capture.rs
@@ -0,0 +1,6 @@
+fn main() {
+    format!("{foo}");                //~ ERROR: there is no argument named `foo`
+
+    // panic! doesn't hit format_args! unless there are two or more arguments.
+    panic!("{foo} {bar}", bar=1);    //~ ERROR: there is no argument named `foo`
+}