about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLieselotte <52315535+she3py@users.noreply.github.com>2024-10-14 23:22:51 +0200
committerLieselotte <52315535+she3py@users.noreply.github.com>2024-10-14 23:22:51 +0200
commitdda3066805ef0a0ad5f2d0d2cdb6bc0b66d8c19b (patch)
treeae5f32f841e40f05c401989c2f9ca7465714a7b9
parent9322d183f45e0fd5a509820874cc5ff27744a479 (diff)
downloadrust-dda3066805ef0a0ad5f2d0d2cdb6bc0b66d8c19b.tar.gz
rust-dda3066805ef0a0ad5f2d0d2cdb6bc0b66d8c19b.zip
Remove `'apostrophes'` from `rustc_parse_format`
-rw-r--r--compiler/rustc_index_macros/Cargo.toml2
-rw-r--r--compiler/rustc_parse_format/src/lib.rs8
-rw-r--r--tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs2
-rw-r--r--tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr4
-rw-r--r--tests/ui/diagnostic_namespace/on_unimplemented/broken_format.rs4
-rw-r--r--tests/ui/diagnostic_namespace/on_unimplemented/broken_format.stderr4
-rw-r--r--tests/ui/fmt/closing-brace-as-fill.rs2
-rw-r--r--tests/ui/fmt/closing-brace-as-fill.stderr6
-rw-r--r--tests/ui/fmt/format-string-error-2.rs2
-rw-r--r--tests/ui/fmt/format-string-error-2.stderr56
-rw-r--r--tests/ui/fmt/format-string-error.rs6
-rw-r--r--tests/ui/fmt/format-string-error.stderr24
-rw-r--r--tests/ui/fmt/format-string-wrong-order.rs4
-rw-r--r--tests/ui/fmt/format-string-wrong-order.stderr8
-rw-r--r--tests/ui/fmt/ifmt-bad-arg.rs2
-rw-r--r--tests/ui/fmt/ifmt-bad-arg.stderr8
-rw-r--r--tests/ui/fmt/issue-91556.rs4
-rw-r--r--tests/ui/fmt/issue-91556.stderr4
-rw-r--r--tests/ui/fmt/respanned-literal-issue-106191.rs4
-rw-r--r--tests/ui/fmt/respanned-literal-issue-106191.stderr8
-rw-r--r--tests/ui/macros/issue-51848.stderr4
21 files changed, 83 insertions, 83 deletions
diff --git a/compiler/rustc_index_macros/Cargo.toml b/compiler/rustc_index_macros/Cargo.toml
index 07ee81788ce..a7c2a1804dd 100644
--- a/compiler/rustc_index_macros/Cargo.toml
+++ b/compiler/rustc_index_macros/Cargo.toml
@@ -7,7 +7,7 @@ edition = "2021"
 proc-macro = true
 
 [dependencies]
-syn = { version = "2.0.9", features = ["full"] }
+syn = { version = "2.0.9", features = ["full", "extra-traits"] }
 proc-macro2 = "1"
 quote = "1"
 
diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs
index e7ef4385baf..1716f417969 100644
--- a/compiler/rustc_parse_format/src/lib.rs
+++ b/compiler/rustc_parse_format/src/lib.rs
@@ -473,19 +473,19 @@ impl<'a> Parser<'a> {
             }
 
             pos = peek_pos;
-            description = format!("expected `'}}'`, found `{maybe:?}`");
+            description = format!("expected `}}`, found `{}`", maybe.escape_debug());
         } else {
-            description = "expected `'}'` but string was terminated".to_owned();
+            description = "expected `}` but string was terminated".to_owned();
             // point at closing `"`
             pos = self.input.len() - if self.append_newline { 1 } else { 0 };
         }
 
         let pos = self.to_span_index(pos);
 
-        let label = "expected `'}'`".to_owned();
+        let label = "expected `}`".to_owned();
         let (note, secondary_label) = if arg.format.fill == Some('}') {
             (
-                Some("the character `'}'` is interpreted as a fill character because of the `:` that precedes it".to_owned()),
+                Some("the character `}` is interpreted as a fill character because of the `:` that precedes it".to_owned()),
                 arg.format.fill_span.map(|sp| ("this is not interpreted as a formatting closing brace".to_owned(), sp)),
             )
         } else {
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
index e8cec632177..1577b68e748 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
@@ -178,7 +178,7 @@ struct ErrorWithNonexistentField {
 }
 
 #[derive(Diagnostic)]
-//~^ ERROR invalid format string: expected `'}'`
+//~^ ERROR invalid format string: expected `}`
 #[diag(no_crate_example, code = E0123)]
 struct ErrorMissingClosingBrace {
     #[suggestion(no_crate_suggestion, code = "{name")]
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
index 97f9896f3a7..ff7af388514 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
@@ -184,11 +184,11 @@ error: `name` doesn't refer to a field on this type
 LL |     #[suggestion(no_crate_suggestion, code = "{name}")]
    |                                              ^^^^^^^^
 
-error: invalid format string: expected `'}'` but string was terminated
+error: invalid format string: expected `}` but string was terminated
   --> $DIR/diagnostic-derive.rs:180:10
    |
 LL | #[derive(Diagnostic)]
-   |          ^^^^^^^^^^ expected `'}'` in format string
+   |          ^^^^^^^^^^ expected `}` in format string
    |
    = note: if you intended to print `{`, you can escape it using `{{`
    = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/broken_format.rs b/tests/ui/diagnostic_namespace/on_unimplemented/broken_format.rs
index 8d8917fd319..3ca58b28181 100644
--- a/tests/ui/diagnostic_namespace/on_unimplemented/broken_format.rs
+++ b/tests/ui/diagnostic_namespace/on_unimplemented/broken_format.rs
@@ -19,8 +19,8 @@ trait ImportantTrait3 {}
 trait ImportantTrait4 {}
 
 #[diagnostic::on_unimplemented(message = "Test {Self:!}")]
-//~^WARN expected `'}'`, found `'!'`
-//~|WARN expected `'}'`, found `'!'`
+//~^WARN expected `}`, found `!`
+//~|WARN expected `}`, found `!`
 //~|WARN unmatched `}` found
 //~|WARN unmatched `}` found
 trait ImportantTrait5 {}
diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/broken_format.stderr b/tests/ui/diagnostic_namespace/on_unimplemented/broken_format.stderr
index 932e81ca48e..b4ed06cb63d 100644
--- a/tests/ui/diagnostic_namespace/on_unimplemented/broken_format.stderr
+++ b/tests/ui/diagnostic_namespace/on_unimplemented/broken_format.stderr
@@ -30,7 +30,7 @@ LL | #[diagnostic::on_unimplemented(message = "Test {Self:123}")]
    |
    = help: no format specifier are supported in this position
 
-warning: expected `'}'`, found `'!'`
+warning: expected `}`, found `!`
   --> $DIR/broken_format.rs:21:32
    |
 LL | #[diagnostic::on_unimplemented(message = "Test {Self:!}")]
@@ -153,7 +153,7 @@ note: required by a bound in `check_4`
 LL | fn check_4(_: impl ImportantTrait4) {}
    |                    ^^^^^^^^^^^^^^^ required by this bound in `check_4`
 
-warning: expected `'}'`, found `'!'`
+warning: expected `}`, found `!`
   --> $DIR/broken_format.rs:21:32
    |
 LL | #[diagnostic::on_unimplemented(message = "Test {Self:!}")]
diff --git a/tests/ui/fmt/closing-brace-as-fill.rs b/tests/ui/fmt/closing-brace-as-fill.rs
index 6ad257f943e..5865ee31c43 100644
--- a/tests/ui/fmt/closing-brace-as-fill.rs
+++ b/tests/ui/fmt/closing-brace-as-fill.rs
@@ -4,5 +4,5 @@
 
 fn main() {
     println!("Hello, world! {0:}<3", 2);
-    //~^ ERROR invalid format string: expected `'}'` but string was terminated
+    //~^ ERROR invalid format string: expected `}` but string was terminated
 }
diff --git a/tests/ui/fmt/closing-brace-as-fill.stderr b/tests/ui/fmt/closing-brace-as-fill.stderr
index 70068fa3aad..aa22beddf45 100644
--- a/tests/ui/fmt/closing-brace-as-fill.stderr
+++ b/tests/ui/fmt/closing-brace-as-fill.stderr
@@ -1,12 +1,12 @@
-error: invalid format string: expected `'}'` but string was terminated
+error: invalid format string: expected `}` but string was terminated
   --> $DIR/closing-brace-as-fill.rs:6:35
    |
 LL |     println!("Hello, world! {0:}<3", 2);
-   |                                -  ^ expected `'}'` in format string
+   |                                -  ^ expected `}` in format string
    |                                |
    |                                this is not interpreted as a formatting closing brace
    |
-   = note: the character `'}'` is interpreted as a fill character because of the `:` that precedes it
+   = note: the character `}` is interpreted as a fill character because of the `:` that precedes it
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/fmt/format-string-error-2.rs b/tests/ui/fmt/format-string-error-2.rs
index 1f7f0d8f6be..357dd7b10a3 100644
--- a/tests/ui/fmt/format-string-error-2.rs
+++ b/tests/ui/fmt/format-string-error-2.rs
@@ -72,7 +72,7 @@ raw  { \n
 
     // note: `\x7B` is `{`
     println!("\x7B}\u{8} {", 1);
-    //~^ ERROR invalid format string: expected `'}'` but string was terminated
+    //~^ ERROR invalid format string: expected `}` but string was terminated
 
     println!("\x7B}\u8 {", 1);
     //~^ ERROR incorrect unicode escape sequence
diff --git a/tests/ui/fmt/format-string-error-2.stderr b/tests/ui/fmt/format-string-error-2.stderr
index d5fe4081ac8..a2d142e0bab 100644
--- a/tests/ui/fmt/format-string-error-2.stderr
+++ b/tests/ui/fmt/format-string-error-2.stderr
@@ -9,138 +9,138 @@ help: format of unicode escape sequences uses braces
 LL |     println!("\x7B}\u{8} {", 1);
    |                    ~~~~~
 
-error: invalid format string: expected `'}'`, found `'a'`
+error: invalid format string: expected `}`, found `a`
   --> $DIR/format-string-error-2.rs:5:5
    |
 LL |     format!("{
    |              - because of this opening brace
 LL |     a");
-   |     ^ expected `'}'` in format string
+   |     ^ expected `}` in format string
    |
    = note: if you intended to print `{`, you can escape it using `{{`
 
-error: invalid format string: expected `'}'`, found `'b'`
+error: invalid format string: expected `}`, found `b`
   --> $DIR/format-string-error-2.rs:9:5
    |
 LL |     format!("{ \
    |              - because of this opening brace
 LL |                \
 LL |     b");
-   |     ^ expected `'}'` in format string
+   |     ^ expected `}` in format string
    |
    = note: if you intended to print `{`, you can escape it using `{{`
 
-error: invalid format string: expected `'}'`, found `'\'`
+error: invalid format string: expected `}`, found `\`
   --> $DIR/format-string-error-2.rs:11:18
    |
 LL |     format!(r#"{ \
-   |                - ^ expected `'}'` in format string
+   |                - ^ 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 `'\'`
+error: invalid format string: expected `}`, found `\`
   --> $DIR/format-string-error-2.rs:15:18
    |
 LL |     format!(r#"{ \n
-   |                - ^ expected `'}'` in format string
+   |                - ^ 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 `'e'`
+error: invalid format string: expected `}`, found `e`
   --> $DIR/format-string-error-2.rs:21:5
    |
 LL |     format!("{ \n
    |              - because of this opening brace
 LL | \n
 LL |     e");
-   |     ^ expected `'}'` in format string
+   |     ^ expected `}` in format string
    |
    = note: if you intended to print `{`, you can escape it using `{{`
 
-error: invalid format string: expected `'}'`, found `'a'`
+error: invalid format string: expected `}`, found `a`
   --> $DIR/format-string-error-2.rs:25:5
    |
 LL |     {
    |     - because of this opening brace
 LL |     a");
-   |     ^ expected `'}'` in format string
+   |     ^ expected `}` in format string
    |
    = note: if you intended to print `{`, you can escape it using `{{`
 
-error: invalid format string: expected `'}'`, found `'a'`
+error: invalid format string: expected `}`, found `a`
   --> $DIR/format-string-error-2.rs:29:5
    |
 LL |     {
    |     - because of this opening brace
 LL |     a
-   |     ^ expected `'}'` in format string
+   |     ^ expected `}` in format string
    |
    = note: if you intended to print `{`, you can escape it using `{{`
 
-error: invalid format string: expected `'}'`, found `'b'`
+error: invalid format string: expected `}`, found `b`
   --> $DIR/format-string-error-2.rs:35:5
    |
 LL |     { \
    |     - because of this opening brace
 LL |         \
 LL |     b");
-   |     ^ expected `'}'` in format string
+   |     ^ expected `}` in format string
    |
    = note: if you intended to print `{`, you can escape it using `{{`
 
-error: invalid format string: expected `'}'`, found `'b'`
+error: invalid format string: expected `}`, found `b`
   --> $DIR/format-string-error-2.rs:40:5
    |
 LL |     { \
    |     - because of this opening brace
 LL |         \
 LL |     b \
-   |     ^ expected `'}'` in format string
+   |     ^ expected `}` in format string
    |
    = note: if you intended to print `{`, you can escape it using `{{`
 
-error: invalid format string: expected `'}'`, found `'\'`
+error: invalid format string: expected `}`, found `\`
   --> $DIR/format-string-error-2.rs:45:8
    |
 LL | raw  { \
-   |      - ^ expected `'}'` in format string
+   |      - ^ 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 `'\'`
+error: invalid format string: expected `}`, found `\`
   --> $DIR/format-string-error-2.rs:50:8
    |
 LL | raw  { \n
-   |      - ^ expected `'}'` in format string
+   |      - ^ 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 `'e'`
+error: invalid format string: expected `}`, found `e`
   --> $DIR/format-string-error-2.rs:57:5
    |
 LL |   { \n
    |   - because of this opening brace
 LL | \n
 LL |     e");
-   |     ^ expected `'}'` in format string
+   |     ^ expected `}` in format string
    |
    = note: if you intended to print `{`, you can escape it using `{{`
 
-error: invalid format string: expected `'}'`, found `'a'`
+error: invalid format string: expected `}`, found `a`
   --> $DIR/format-string-error-2.rs:67:5
    |
 LL |     {
    |     - because of this opening brace
 LL |     asdf}
-   |     ^ expected `'}'` in format string
+   |     ^ expected `}` in format string
    |
    = note: if you intended to print `{`, you can escape it using `{{`
 
@@ -150,11 +150,11 @@ error: 1 positional argument in format string, but no arguments were given
 LL |     println!("\t{}");
    |                 ^^
 
-error: invalid format string: expected `'}'` but string was terminated
+error: invalid format string: expected `}` but string was terminated
   --> $DIR/format-string-error-2.rs:74:27
    |
 LL |     println!("\x7B}\u{8} {", 1);
-   |                          -^ expected `'}'` in format string
+   |                          -^ expected `}` in format string
    |                          |
    |                          because of this opening brace
    |
diff --git a/tests/ui/fmt/format-string-error.rs b/tests/ui/fmt/format-string-error.rs
index 9b436e2c479..cb9449be532 100644
--- a/tests/ui/fmt/format-string-error.rs
+++ b/tests/ui/fmt/format-string-error.rs
@@ -2,7 +2,7 @@
 
 fn main() {
     println!("{");
-    //~^ ERROR invalid format string: expected `'}'` but string was terminated
+    //~^ ERROR invalid format string: expected `}` but string was terminated
     println!("{{}}");
     println!("}");
     //~^ ERROR invalid format string: unmatched `}` found
@@ -13,11 +13,11 @@ fn main() {
     let _ = format!("{a:._$}", a = "", _ = 0);
     //~^ ERROR invalid format string: invalid argument name `_`
     let _ = format!("{");
-    //~^ ERROR invalid format string: expected `'}'` but string was terminated
+    //~^ ERROR invalid format string: expected `}` but string was terminated
     let _ = format!("}");
     //~^ ERROR invalid format string: unmatched `}` found
     let _ = format!("{\\}");
-    //~^ ERROR invalid format string: expected `'}'`, found `'\'`
+    //~^ ERROR invalid format string: expected `}`, found `\`
     let _ = format!("\n\n\n{\n\n\n");
     //~^ ERROR invalid format string
     let _ = format!(r###"
diff --git a/tests/ui/fmt/format-string-error.stderr b/tests/ui/fmt/format-string-error.stderr
index 37a181e6fcb..9d6a91413d0 100644
--- a/tests/ui/fmt/format-string-error.stderr
+++ b/tests/ui/fmt/format-string-error.stderr
@@ -1,8 +1,8 @@
-error: invalid format string: expected `'}'` but string was terminated
+error: invalid format string: expected `}` but string was terminated
   --> $DIR/format-string-error.rs:4:16
    |
 LL |     println!("{");
-   |               -^ expected `'}'` in format string
+   |               -^ expected `}` in format string
    |               |
    |               because of this opening brace
    |
@@ -40,11 +40,11 @@ LL |     let _ = format!("{a:._$}", a = "", _ = 0);
    |
    = note: argument name cannot be a single underscore
 
-error: invalid format string: expected `'}'` but string was terminated
+error: invalid format string: expected `}` but string was terminated
   --> $DIR/format-string-error.rs:15:23
    |
 LL |     let _ = format!("{");
-   |                      -^ expected `'}'` in format string
+   |                      -^ expected `}` in format string
    |                      |
    |                      because of this opening brace
    |
@@ -58,44 +58,44 @@ LL |     let _ = format!("}");
    |
    = note: if you intended to print `}`, you can escape it using `}}`
 
-error: invalid format string: expected `'}'`, found `'\'`
+error: invalid format string: expected `}`, found `\`
   --> $DIR/format-string-error.rs:19:23
    |
 LL |     let _ = format!("{\}");
-   |                      -^ expected `'}'` in format string
+   |                      -^ 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 `'}'` but string was terminated
+error: invalid format string: expected `}` but string was terminated
   --> $DIR/format-string-error.rs:21:35
    |
 LL |     let _ = format!("\n\n\n{\n\n\n");
-   |                            -      ^ expected `'}'` in format string
+   |                            -      ^ 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 `'}'` but string was terminated
+error: invalid format string: expected `}` but string was terminated
   --> $DIR/format-string-error.rs:27:3
    |
 LL |     {"###);
-   |     -^ expected `'}'` in format string
+   |     -^ 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 `'}'` but string was terminated
+error: invalid format string: expected `}` but string was terminated
   --> $DIR/format-string-error.rs:35:1
    |
 LL |     {
    |     - because of this opening brace
 LL |
 LL | "###);
-   | ^ expected `'}'` in format string
+   | ^ expected `}` in format string
    |
    = note: if you intended to print `{`, you can escape it using `{{`
 
diff --git a/tests/ui/fmt/format-string-wrong-order.rs b/tests/ui/fmt/format-string-wrong-order.rs
index da775be3ffd..891279b97e4 100644
--- a/tests/ui/fmt/format-string-wrong-order.rs
+++ b/tests/ui/fmt/format-string-wrong-order.rs
@@ -7,9 +7,9 @@ fn main() {
     format!("{?:?}", bar);
     //~^ ERROR invalid format string: expected format parameter to occur after `:`
     format!("{??}", bar);
-    //~^ ERROR invalid format string: expected `'}'`, found `'?'`
+    //~^ ERROR invalid format string: expected `}`, found `?`
     format!("{?;bar}");
-    //~^ ERROR invalid format string: expected `'}'`, found `'?'`
+    //~^ ERROR invalid format string: expected `}`, found `?`
     format!("{?:#?}", bar);
     //~^ ERROR invalid format string: expected format parameter to occur after `:`
     format!("Hello {<5:}!", "x");
diff --git a/tests/ui/fmt/format-string-wrong-order.stderr b/tests/ui/fmt/format-string-wrong-order.stderr
index 3ef07720c15..7f017511761 100644
--- a/tests/ui/fmt/format-string-wrong-order.stderr
+++ b/tests/ui/fmt/format-string-wrong-order.stderr
@@ -22,21 +22,21 @@ LL |     format!("{?:?}", bar);
    |
    = note: `?` comes after `:`, try `:?` instead
 
-error: invalid format string: expected `'}'`, found `'?'`
+error: invalid format string: expected `}`, found `?`
   --> $DIR/format-string-wrong-order.rs:9:15
    |
 LL |     format!("{??}", bar);
-   |              -^ expected `'}'` in format string
+   |              -^ 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 `'?'`
+error: invalid format string: expected `}`, found `?`
   --> $DIR/format-string-wrong-order.rs:11:15
    |
 LL |     format!("{?;bar}");
-   |              -^ expected `'}'` in format string
+   |              -^ expected `}` in format string
    |              |
    |              because of this opening brace
    |
diff --git a/tests/ui/fmt/ifmt-bad-arg.rs b/tests/ui/fmt/ifmt-bad-arg.rs
index 68861d7bf3f..e39ffb8fe1b 100644
--- a/tests/ui/fmt/ifmt-bad-arg.rs
+++ b/tests/ui/fmt/ifmt-bad-arg.rs
@@ -48,7 +48,7 @@ fn main() {
 
     // bad syntax of the format string
 
-    format!("{"); //~ ERROR: expected `'}'` but string was terminated
+    format!("{"); //~ ERROR: expected `}` but string was terminated
 
     format!("foo } bar"); //~ ERROR: unmatched `}` found
     format!("foo }"); //~ ERROR: unmatched `}` found
diff --git a/tests/ui/fmt/ifmt-bad-arg.stderr b/tests/ui/fmt/ifmt-bad-arg.stderr
index 09ce3dca411..4344aee83c2 100644
--- a/tests/ui/fmt/ifmt-bad-arg.stderr
+++ b/tests/ui/fmt/ifmt-bad-arg.stderr
@@ -136,11 +136,11 @@ LL |     format!("{valuea} {valueb}", valuea=5, valuec=7);
    |             |
    |             formatting specifier missing
 
-error: invalid format string: expected `'}'` but string was terminated
+error: invalid format string: expected `}` but string was terminated
   --> $DIR/ifmt-bad-arg.rs:51:15
    |
 LL |     format!("{");
-   |              -^ expected `'}'` in format string
+   |              -^ expected `}` in format string
    |              |
    |              because of this opening brace
    |
@@ -172,13 +172,13 @@ LL |     format!("foo %s baz", "bar");
    |
    = note: printf formatting is not supported; see the documentation for `std::fmt`
 
-error: invalid format string: expected `'}'`, found `'t'`
+error: invalid format string: expected `}`, found `t`
   --> $DIR/ifmt-bad-arg.rs:75:1
    |
 LL | ninth number: {
    |               - because of this opening brace
 LL | tenth number: {}",
-   | ^ expected `'}'` in format string
+   | ^ expected `}` in format string
    |
    = note: if you intended to print `{`, you can escape it using `{{`
 
diff --git a/tests/ui/fmt/issue-91556.rs b/tests/ui/fmt/issue-91556.rs
index e782e6f9076..fcf8909859c 100644
--- a/tests/ui/fmt/issue-91556.rs
+++ b/tests/ui/fmt/issue-91556.rs
@@ -1,8 +1,8 @@
 fn main() {
   let _ = format!(concat!("{0}π–³π–Ύπ—Œπ—{"), i);
-  //~^ ERROR: invalid format string: expected `'}'` but string was terminated
+  //~^ 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
+  //~| NOTE: expected `}` in format string
 }
diff --git a/tests/ui/fmt/issue-91556.stderr b/tests/ui/fmt/issue-91556.stderr
index beab3db0d94..52917fb8c42 100644
--- a/tests/ui/fmt/issue-91556.stderr
+++ b/tests/ui/fmt/issue-91556.stderr
@@ -1,8 +1,8 @@
-error: invalid format string: expected `'}'` but string was terminated
+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
+   |                   ^^^^^^^^^^^^^^^^^^^ 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)
diff --git a/tests/ui/fmt/respanned-literal-issue-106191.rs b/tests/ui/fmt/respanned-literal-issue-106191.rs
index b0c0855a870..0a127b1a0ca 100644
--- a/tests/ui/fmt/respanned-literal-issue-106191.rs
+++ b/tests/ui/fmt/respanned-literal-issue-106191.rs
@@ -4,7 +4,7 @@ extern crate format_string_proc_macro;
 
 fn main() {
     format_string_proc_macro::respan_to_invalid_format_literal!("Β‘");
-    //~^ ERROR invalid format string: expected `'}'` but string was terminated
+    //~^ ERROR invalid format string: expected `}` but string was terminated
     format_args!(r#concat!("Β‘        {"));
-    //~^ ERROR invalid format string: expected `'}'` but string was terminated
+    //~^ ERROR invalid format string: expected `}` but string was terminated
 }
diff --git a/tests/ui/fmt/respanned-literal-issue-106191.stderr b/tests/ui/fmt/respanned-literal-issue-106191.stderr
index 73a3af65a38..17ab29e799b 100644
--- a/tests/ui/fmt/respanned-literal-issue-106191.stderr
+++ b/tests/ui/fmt/respanned-literal-issue-106191.stderr
@@ -1,16 +1,16 @@
-error: invalid format string: expected `'}'` but string was terminated
+error: invalid format string: expected `}` but string was terminated
   --> $DIR/respanned-literal-issue-106191.rs:6:65
    |
 LL |     format_string_proc_macro::respan_to_invalid_format_literal!("Β‘");
-   |                                                                 ^^^ expected `'}'` in format string
+   |                                                                 ^^^ expected `}` in format string
    |
    = note: if you intended to print `{`, you can escape it using `{{`
 
-error: invalid format string: expected `'}'` but string was terminated
+error: invalid format string: expected `}` but string was terminated
   --> $DIR/respanned-literal-issue-106191.rs:8:18
    |
 LL |     format_args!(r#concat!("Β‘        {"));
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^ expected `'}'` in format string
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^ 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)
diff --git a/tests/ui/macros/issue-51848.stderr b/tests/ui/macros/issue-51848.stderr
index c25bedf37b7..30b64113d73 100644
--- a/tests/ui/macros/issue-51848.stderr
+++ b/tests/ui/macros/issue-51848.stderr
@@ -1,8 +1,8 @@
-error: invalid format string: expected `'}'` but string was terminated
+error: invalid format string: expected `}` but string was terminated
   --> $DIR/issue-51848.rs:6:20
    |
 LL |         println!("{");
-   |                   -^ expected `'}'` in format string
+   |                   -^ expected `}` in format string
    |                   |
    |                   because of this opening brace
 ...