]> git.lizzy.rs Git - rust.git/blob - src/test/ui/fmt/format-concat-span.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.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 }