This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed
compiler/rustc_builtin_macros/src Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -995,8 +995,9 @@ pub fn expand_preparsed_format_args(
995995 e. note ( & note) ;
996996 }
997997 if let Some ( ( label, span) ) = err. secondary_label {
998- let sp = fmt_span. from_inner ( span) ;
999- e. span_label ( sp, label) ;
998+ if efmt_kind_is_lit {
999+ e. span_label ( fmt_span. from_inner ( span) , label) ;
1000+ }
10001001 }
10011002 e. emit ( ) ;
10021003 return DummyResult :: raw_expr ( sp, true ) ;
Original file line number Diff line number Diff line change 1+ fn main ( ) {
2+ let _ = format ! ( concat!( "{0}𝖳𝖾𝗌𝗍{" ) , i) ;
3+ //~^ ERROR: invalid format string: expected `'}'` but string was terminated
4+ //~| NOTE: if you intended to print `{`, you can escape it using `{{`
5+ //~| NOTE: in this expansion of concat!
6+ //~| NOTE: in this expansion of concat!
7+ //~| NOTE: expected `'}'` in format string
8+ }
Original file line number Diff line number Diff line change 1+ error: invalid format string: expected `'}'` but string was terminated
2+ --> $DIR/issue-91556.rs:2:19
3+ |
4+ LL | let _ = format!(concat!("{0}𝖳𝖾𝗌𝗍{"), i);
5+ | ^^^^^^^^^^^^^^^^^^^ expected `'}'` in format string
6+ |
7+ = note: if you intended to print `{`, you can escape it using `{{`
8+ = note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info)
9+
10+ error: aborting due to previous error
11+
You can’t perform that action at this time.
0 commit comments