Auto merge of #55003 - zackmdavis:must_use_assoc_fn, r=varkor
`#[must_use]` for associated functions is supposed to actually work In the comments of (closed, defunct) pull request #54884, @Centril [noted that](https://github.com/rust-lang/rust/pull/54884#issuecomment-427626495) must-use annotations didn't work on an associated function (what other communities might call a "static method"). Subsequent logging revealed that in this case we have a `Def::Method`, whereas the lint pass was only matching on `Def::Fn`. (One could argue that those def-names are thereby misleading—must-use for `self`-ful methods have always worked—but documenting or reworking that can be left to another day.) r? @varkor
Showing
想要评论请 注册 或 登录