-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #96589 - Badel2:source-callsite, r=michaelwoerister
Use source callsite in check_argument_types suggestion This makes the "remove extra arguement" suggestion valid when the function argument is a macro. Additionally, this may fix #96225, but the only way I can reproduce that issue is using the playground, so we will need to wait until after this is merged to ensure it's fixed.
- Loading branch information
Showing
4 changed files
with
38 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// run-rustfix | ||
// Check that the HELP suggestion is `l(vec![])` instead of `l($crate::vec::Vec::new())` | ||
fn l(_a: Vec<u8>) {} | ||
|
||
fn main() { | ||
l(vec![]) | ||
//~^ ERROR this function takes 1 argument but 2 arguments were supplied | ||
//~| HELP remove the extra argument | ||
} |
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,9 @@ | ||
// run-rustfix | ||
// Check that the HELP suggestion is `l(vec![])` instead of `l($crate::vec::Vec::new())` | ||
fn l(_a: Vec<u8>) {} | ||
|
||
fn main() { | ||
l(vec![], vec![]) | ||
//~^ ERROR this function takes 1 argument but 2 arguments were supplied | ||
//~| HELP remove the extra argument | ||
} |
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,19 @@ | ||
error[E0061]: this function takes 1 argument but 2 arguments were supplied | ||
--> $DIR/remove-extra-argument.rs:6:5 | ||
| | ||
LL | l(vec![], vec![]) | ||
| ^ ------ argument unexpected | ||
| | ||
note: function defined here | ||
--> $DIR/remove-extra-argument.rs:3:4 | ||
| | ||
LL | fn l(_a: Vec<u8>) {} | ||
| ^ ----------- | ||
help: remove the extra argument | ||
| | ||
LL | l(vec![]) | ||
| | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0061`. |