Remove invalid suggestion involving Fn trait bound#86400
Merged
bors merged 1 commit intorust-lang:masterfrom Aug 3, 2021
Merged
Remove invalid suggestion involving Fn trait bound#86400bors merged 1 commit intorust-lang:masterfrom
Fn trait bound#86400bors merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
|
(rust-highfive has picked a reviewer for you, use r? to override) |
LeSeulArtichaut
approved these changes
Jun 17, 2021
Contributor
There was a problem hiding this comment.
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
Contributor
|
r? @estebank |
Collaborator
|
☔ The latest upstream changes (presumably #86338) made this pull request unmergeable. Please resolve the merge conflicts. |
estebank
approved these changes
Aug 3, 2021
Contributor
estebank
left a comment
There was a problem hiding this comment.
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
Contributor
|
@bors r=estebank |
Collaborator
|
📌 Commit f8c10ff has been approved by |
Collaborator
Collaborator
|
☀️ Test successful - checks-actions |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/FnOncetrait 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.