-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix the error-causing suggestion of 'borrowed_box' #6200
Conversation
r? @phansch (rust_highfive has picked a reviewer for you, use r? to override) |
☔ The latest upstream changes (presumably #6187) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
fix the error-causing suggestion of 'borrowed_box', which missed parentheses and was ambiguous.
db2eba8
to
e568a32
Compare
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 with typo fixed
@@ -721,6 +734,21 @@ fn is_any_trait(t: &hir::Ty<'_>) -> bool { | |||
false | |||
} | |||
|
|||
fn get_bounds_if_impl_trait<'tcx>(cx: &LateContext<'tcx>, qpath: &QPath<'_>, id: HirId) -> Option<GenericBounds<'tcx>> { |
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.
A typo, it seems?
fn get_bounds_if_impl_trait<'tcx>(cx: &LateContext<'tcx>, qpath: &QPath<'_>, id: HirId) -> Option<GenericBounds<'tcx>> { | |
fn get_bounds_of_impl_trait<'tcx>(cx: &LateContext<'tcx>, qpath: &QPath<'_>, id: HirId) -> Option<GenericBounds<'tcx>> { |
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.
I'm afraid not because it returns None
if the qpath
is not an impl trait, and actually checking whether the qpath
is an impl trait is one of the main role of the function. I named it so hoping it looks similar to get_if_local
. If it's confusing, something like get_bounds_provided_impl_trait
might be more suitable?
@bors r+ thanks! |
📌 Commit e568a32 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Fixes #3128
Fix the suggestion of 'borrowed_box', which causes a syntax error because it misses necessary parentheses.
changelog: Fix the error-causing suggestion of 'borrowed_box'