mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Rollup merge of #54795 - euclio:ifmt-bad-arg, r=estebank
remove padding from multiline format string label Fixes #53836.
This commit is contained in:
commit
71aded852f
@ -288,7 +288,7 @@ impl<'a> Parser<'a> {
|
||||
self.cur.next();
|
||||
Some(pos)
|
||||
} else {
|
||||
let pos = pos + padding + 1;
|
||||
let pos = pos + raw + 1;
|
||||
self.err(format!("expected `{:?}`, found `{:?}`", c, maybe),
|
||||
format!("expected `{}`", c),
|
||||
pos,
|
||||
|
@ -71,4 +71,18 @@ fn main() {
|
||||
|
||||
"##);
|
||||
//~^^^ ERROR: there is no argument named `foo`
|
||||
|
||||
// bad syntax in format string with multiple newlines, #53836
|
||||
format!("first number: {}
|
||||
second number: {}
|
||||
third number: {}
|
||||
fourth number: {}
|
||||
fifth number: {}
|
||||
sixth number: {}
|
||||
seventh number: {}
|
||||
eighth number: {}
|
||||
ninth number: {
|
||||
tenth number: {}",
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
|
||||
//~^^ ERROR: invalid format string
|
||||
}
|
||||
|
@ -204,5 +204,11 @@ error: there is no argument named `foo`
|
||||
LL | {foo}
|
||||
| ^^^^^
|
||||
|
||||
error: aborting due to 27 previous errors
|
||||
error: invalid format string: expected `'}'`, found `'t'`
|
||||
--> $DIR/ifmt-bad-arg.rs:85:1
|
||||
|
|
||||
LL | tenth number: {}",
|
||||
| ^ expected `}` in format string
|
||||
|
||||
error: aborting due to 28 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user