-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Remove invalid suggestion involving Fn
trait bound
#86400
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
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.
Looks good to me, but I don't feel too comfortable approving, so I'll delegate to @estebank. Left two potential nitpicks
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
r? @estebank |
☔ The latest upstream changes (presumably #86338) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
r=me after addressing @LeSeulArtichaut's comments.
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
e8defe4
to
f8c10ff
Compare
@bors r=estebank |
📌 Commit f8c10ff has been approved by |
☀️ Test successful - checks-actions |
This pull request closes #85735. The actual issue is a duplicate of #21974, but #85735 contains a further problem, which is an invalid suggestion if
Fn
/FnMut
/FnOnce
trait bounds are involved: The suggestion code checks whether the trait bound ends with>
to determine whether it has any generic arguments, but theFn*
traits have a special syntax for generic arguments that doesn't involve angle brackets. The example given in #85735:currently produces:
which is incorrect, because there is no function call, and applying the suggestion would lead to a parse error. With my changes, I get:
i.e. I have added a check to prevent the invalid suggestion from being issued for
Fn*
bounds, while the underlying issue #21974 remains for now.