-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dedup for duplicate suggestions #118057
dedup for duplicate suggestions #118057
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
macro_rules! foo { | ||
($ty:ty) => { | ||
fn foo(_: $ty, _: $ty) {} | ||
} | ||
} | ||
|
||
foo!(_); | ||
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for functions | ||
|
||
fn main() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions | ||
--> $DIR/issue-118048.rs:7:6 | ||
| | ||
LL | foo!(_); | ||
| ^ | ||
| | | ||
| not allowed in type signatures | ||
| not allowed in type signatures | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's worth noting that for this case, there's a duplicate label generated by |
||
| | ||
help: use type parameters instead | ||
| | ||
LL ~ fn foo<T>(_: $ty, _: $ty) {} | ||
LL | } | ||
LL | } | ||
LL | | ||
LL ~ foo!(T); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. previously it displayed here as |
||
| | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0121`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we dedup after sorting? In case we have
[(first span, first stuff), (second span, second stuff), (first span, first stuff)]
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great tips! Before this, I always assumed that
Vec::dedup
was equivalent to Vec::from(HashSet::from(vector))
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not sort suggestions twice. They are already sorted by span a few lines below.