summaryrefslogtreecommitdiffstats
path: root/tests/ui/fmt/format-args-capture-issue-93378.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/fmt/format-args-capture-issue-93378.rs')
-rw-r--r--tests/ui/fmt/format-args-capture-issue-93378.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/fmt/format-args-capture-issue-93378.rs b/tests/ui/fmt/format-args-capture-issue-93378.rs
new file mode 100644
index 000000000..9d722a028
--- /dev/null
+++ b/tests/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: 3 positional arguments in format string, but there is 1 argument
+
+ let n = 1;
+ println!("{a:.n$} {b:.*}");
+ //~^ ERROR: 1 positional argument in format string, but no arguments were given
+}