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
Don't emit RETURN_SELF_NOT_MUST_USE lint if Self
already is marked as #[must_use]
#8146
Conversation
r? @Manishearth (rust-highfive has picked a reviewer for you, use r? to override) |
8300d2b
to
0426f80
Compare
r? @xFrednet |
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.
One small question, it otherwise looks good to me 🙃
@@ -50,6 +51,7 @@ fn check_method(cx: &LateContext<'tcx>, decl: &'tcx FnDecl<'tcx>, fn_def: LocalD | |||
if decl.implicit_self.has_implicit_self(); | |||
// We only show this warning for public exported methods. | |||
if cx.access_levels.is_exported(fn_def); | |||
if !cx.tcx.hir().attrs(hir_id).iter().any(|attr| attr.has_name(sym::must_use)); |
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.
Isn't this case covered by the must_use_attr
check in line 57?
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.
Indeed but apparently it's not working as it should. I'll clean up though. Good catch!
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.
(Which was fixed in #8143 but I realized it would be better checked here instead.)
0426f80
to
63ccb79
Compare
Updated! |
…as `#[must_use]`
63ccb79
to
07a00ef
Compare
And removed the warning as well. |
LGTM, thank you for following up on these bugs 👍. Let's hope it was the last one 🙃 @bors r+ |
📌 Commit 07a00ef has been approved by |
I hope as well! Thanks for the quick reviews! |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
@xFrednet Just to confirm: I still have this bug showing up when working on
Has this patch been "merged" into the nightly or not yet? |
Hey @GuillaumeGomez, the fix has not been merged into nightly. The sync is usually done Thursdays, meaning today it should be synced. However, it might be delayed due to holidays and such. I can ping you on the sync PR or here if you like 🙃 |
Yes please! Thank you! |
The regular sync will be next week Thursday. I can do an out-of-cycle sync today, if you need this fix tomorrow. |
No hurry, don't worry. Before beta/stable release would be nice though. ;) |
Yes, this will get in before beta branch 👍 (famous last words) |
New bug discovered with this lint. Hopefully, this is the last one.
changelog: none