mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 07:22:42 +00:00
Tweak duplicate fmt arg error
This commit is contained in:
parent
9c97d73a2d
commit
1eeed17c9e
@ -172,7 +172,8 @@ fn parse_args<'a>(
|
||||
let e = p.parse_expr()?;
|
||||
if let Some(prev) = names.get(&name) {
|
||||
ecx.struct_span_err(e.span, &format!("duplicate argument named `{}`", name))
|
||||
.span_note(args[*prev].span, "previously here")
|
||||
.span_label(args[*prev].span, "previously here")
|
||||
.span_label(e.span, "duplicate argument")
|
||||
.emit();
|
||||
continue;
|
||||
}
|
||||
|
@ -138,13 +138,9 @@ error: duplicate argument named `foo`
|
||||
--> $DIR/ifmt-bad-arg.rs:40:33
|
||||
|
|
||||
LL | format!("{foo}", foo=1, foo=2);
|
||||
| ^
|
||||
|
|
||||
note: previously here
|
||||
--> $DIR/ifmt-bad-arg.rs:40:26
|
||||
|
|
||||
LL | format!("{foo}", foo=1, foo=2);
|
||||
| ^
|
||||
| - ^ duplicate argument
|
||||
| |
|
||||
| previously here
|
||||
|
||||
error: positional arguments cannot follow named arguments
|
||||
--> $DIR/ifmt-bad-arg.rs:41:35
|
||||
|
Loading…
Reference in New Issue
Block a user