about summary refs log tree commit diff
path: root/src/test/ui/fmt/format-args-capture-issue-93378.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/fmt/format-args-capture-issue-93378.rs')
-rw-r--r--src/test/ui/fmt/format-args-capture-issue-93378.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/fmt/format-args-capture-issue-93378.rs b/src/test/ui/fmt/format-args-capture-issue-93378.rs
new file mode 100644
index 00000000000..67444444264
--- /dev/null
+++ b/src/test/ui/fmt/format-args-capture-issue-93378.rs
@@ -0,0 +1,11 @@
+fn main() {
+    let a = "a";
+    let b = "b";
+
+    println!("{a} {b} {} {} {c} {}", c = "c");
+    //~^ ERROR: invalid reference to positional arguments 1 and 2 (there is 1 argument)
+
+    let n = 1;
+    println!("{a:.n$} {b:.*}");
+    //~^ ERROR: invalid reference to positional argument 0 (no arguments were given)
+}