forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only give autofix suggestion when no named args are present
- Loading branch information
1 parent
38b0182
commit c8ee7db
Showing
6 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
fn main() { | ||
let x = "x"; | ||
let y = "y"; | ||
|
||
println!("{x}", x, x = y); | ||
//~^ ERROR: redundant argument | ||
|
||
println!("{x}", x = y, x = y); | ||
//~^ ERROR: duplicate argument named `x` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
error: redundant argument | ||
--> $DIR/issue-105225-named-args.rs:5:21 | ||
| | ||
LL | println!("{x}", x, x = y); | ||
| ^ | ||
| | ||
note: the formatting specifier is referencing the binding already | ||
--> $DIR/issue-105225-named-args.rs:5:16 | ||
| | ||
LL | println!("{x}", x, x = y); | ||
| ^ | ||
|
||
error: duplicate argument named `x` | ||
--> $DIR/issue-105225-named-args.rs:8:28 | ||
| | ||
LL | println!("{x}", x = y, x = y); | ||
| - ^ duplicate argument | ||
| | | ||
| previously here | ||
|
||
error: aborting due to 2 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters