Uh oh!
There was an error while loading. Please reload this page.
#[must_use] for associated functions is supposed to actually work - #55003
Conversation
rust-highfive
commented
Oct 12, 2018
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
b94903d to
718609bComparezackmdavis
commented
Oct 13, 2018
(Travis pointed out that this affected some doctests in liballoc!) |
rust-highfive
commented
Oct 13, 2018
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
In the comments of (closed, defunct) pull request rust-lang#54884, Mazdak "Centril" Farrokhzad noted that 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.)
718609b to
ab91a6bComparevarkor
commented
Oct 13, 2018
That is quite confusing. It'd be good to address this later, I agree. @bors r+ |
bors
commented
Oct 13, 2018
📌 Commit ab91a6b has been approved by |
bors
commented
Oct 13, 2018
`#[must_use]` for associated functions is supposed to actually work In the comments of (closed, defunct) pull request #54884, @Centril [noted that](#54884 (comment)) 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
bors
commented
Oct 13, 2018
☀️ Test successful - status-appveyor, status-travis |
In the comments of (closed, defunct) pull request #54884, @Centrilnoted that 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 onDef::Fn. (One could argue that those def-names are thereby misleading—must-use forself-ful methods have always worked—but documenting or reworking that can be left to another day.)r? @varkor