

Don't emit RETURN_SELF_NOT_MUST_USE lint if `Self` already is marked as `#[must_...
source link: https://github.com/rust-lang/rust-clippy/pull/8146
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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));
Isn't this case covered by the must_use_attr
check in line 57?
Indeed but apparently it's not working as it should. I'll clean up though. Good catch!
(Which was fixed in #8143 but I realized it would be better checked here instead.)
Recommend
-
28
关于Emit的博客已经进入第四篇,在读本篇博文之前,我希望读者能先仔细回顾博主之前所编写的关于Emit的博文,从该篇博文开始,我们就可以真正的使用Emit,并把知识转化为实战,我也会把之前的博文链接放在下方,以方便读者阅读,大家也可...
-
10
0. 前言 首先立马解释一波为啥会有这样一篇伪标题的Demo随笔呢? 不是本人有知识误区,或者要误人子弟 因为大家都知道emit写出来的都是同步方法,不可能await,至少现在这么多年来没有提供对应的功能
-
17
Conversation Copy link Contributor ...
-
6
New issue Ensure that RETURN_SELF_NOT_MUST_USE is not emitted if the method already has #[must_use] #8143
-
11
Copy link Member eddyb commented...
-
6
Copy link Contributor ...
-
13
“Why do some objects emit a ‘pitchless’ sound when hit, and others a 'tuned’ sound?”...
-
11
Google Pixel 3 in all colorways (Image credit: Android Central)...
-
11
Game at 4K with ASUS’ TUF 28-inch monitor marked down 24% in return to low of $249 ...
-
12
Stressed Plants Emit Sounds That Can Be Detected More Than a Meter Away Follow Slashdot stories on Twitter...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK