about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/fmt/issue-91556.rs8
-rw-r--r--src/test/ui/fmt/issue-91556.stderr11
2 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/fmt/issue-91556.rs b/src/test/ui/fmt/issue-91556.rs
new file mode 100644
index 00000000000..e782e6f9076
--- /dev/null
+++ b/src/test/ui/fmt/issue-91556.rs
@@ -0,0 +1,8 @@
+fn main() {
+  let _ = format!(concat!("{0}π–³π–Ύπ—Œπ—{"), i);
+  //~^ ERROR: invalid format string: expected `'}'` but string was terminated
+  //~| NOTE: if you intended to print `{`, you can escape it using `{{`
+  //~| NOTE: in this expansion of concat!
+  //~| NOTE: in this expansion of concat!
+  //~| NOTE: expected `'}'` in format string
+}
diff --git a/src/test/ui/fmt/issue-91556.stderr b/src/test/ui/fmt/issue-91556.stderr
new file mode 100644
index 00000000000..dbd5aef458b
--- /dev/null
+++ b/src/test/ui/fmt/issue-91556.stderr
@@ -0,0 +1,11 @@
+error: invalid format string: expected `'}'` but string was terminated
+  --> $DIR/issue-91556.rs:2:19
+   |
+LL |   let _ = format!(concat!("{0}π–³π–Ύπ—Œπ—{"), i);
+   |                   ^^^^^^^^^^^^^^^^^^^ expected `'}'` in format string
+   |
+   = note: if you intended to print `{`, you can escape it using `{{`
+   = note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to previous error
+