summaryrefslogtreecommitdiffstats
path: root/tests/ui/fmt/format-string-wrong-order.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:50 +0000
commit2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35 (patch)
treed325add32978dbdc1db975a438b3a77d571b1ab8 /tests/ui/fmt/format-string-wrong-order.stderr
parentReleasing progress-linux version 1.68.2+dfsg1-1~progress7.99u1. (diff)
downloadrustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.tar.xz
rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.zip
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/fmt/format-string-wrong-order.stderr')
-rw-r--r--tests/ui/fmt/format-string-wrong-order.stderr54
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/ui/fmt/format-string-wrong-order.stderr b/tests/ui/fmt/format-string-wrong-order.stderr
new file mode 100644
index 000000000..461af354a
--- /dev/null
+++ b/tests/ui/fmt/format-string-wrong-order.stderr
@@ -0,0 +1,54 @@
+error: invalid format string: expected format parameter to occur after `:`
+ --> $DIR/format-string-wrong-order.rs:3:15
+ |
+LL | format!("{?:}", bar);
+ | ^ expected `?` to occur after `:` in format string
+ |
+ = note: `?` comes after `:`, try `:?` instead
+
+error: invalid format string: expected format parameter to occur after `:`
+ --> $DIR/format-string-wrong-order.rs:5:15
+ |
+LL | format!("{?:bar}");
+ | ^ expected `?` to occur after `:` in format string
+ |
+ = note: `?` comes after `:`, try `bar:?` instead
+
+error: invalid format string: expected format parameter to occur after `:`
+ --> $DIR/format-string-wrong-order.rs:7:15
+ |
+LL | format!("{?:?}", bar);
+ | ^ expected `?` to occur after `:` in format string
+ |
+ = note: `?` comes after `:`, try `:?` instead
+
+error: invalid format string: expected `'}'`, found `'?'`
+ --> $DIR/format-string-wrong-order.rs:9:15
+ |
+LL | format!("{??}", bar);
+ | -^ expected `}` in format string
+ | |
+ | because of this opening brace
+ |
+ = note: if you intended to print `{`, you can escape it using `{{`
+
+error: invalid format string: expected `'}'`, found `'?'`
+ --> $DIR/format-string-wrong-order.rs:11:15
+ |
+LL | format!("{?;bar}");
+ | -^ expected `}` in format string
+ | |
+ | because of this opening brace
+ |
+ = note: if you intended to print `{`, you can escape it using `{{`
+
+error: invalid format string: expected format parameter to occur after `:`
+ --> $DIR/format-string-wrong-order.rs:13:15
+ |
+LL | format!("{?:#?}", bar);
+ | ^ expected `?` to occur after `:` in format string
+ |
+ = note: `?` comes after `:`, try `:?` instead
+
+error: aborting due to 6 previous errors
+