1
Fork 0
rust/src/test/ui/fmt/format-concat-span.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
464 B
Rust
Raw Normal View History

2021-06-07 17:42:42 +02:00
// If the format string is another macro invocation, rustc would previously
// compute nonsensical spans, such as:
//
// error: invalid format string: unmatched `}` found
// --> test.rs:2:17
// |
// 2 | format!(concat!("abc}"));
// | ^ unmatched `}` in format string
//
// This test checks that this behavior has been fixed.
fn main() {
format!(concat!("abc}"));
//~^ ERROR: invalid format string: unmatched `}` found
}