]> git.proxmox.com Git - rustc.git/blob - src/test/ui/fmt/format-concat-span.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / fmt / format-concat-span.rs
1 // If the format string is another macro invocation, rustc would previously
2 // compute nonsensical spans, such as:
3 //
4 // error: invalid format string: unmatched `}` found
5 // --> test.rs:2:17
6 // |
7 // 2 | format!(concat!("abc}"));
8 // | ^ unmatched `}` in format string
9 //
10 // This test checks that this behavior has been fixed.
11
12 fn main() {
13 format!(concat!("abc}"));
14 //~^ ERROR: invalid format string: unmatched `}` found
15 }