Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for RFC 1940: allow `#[must_use]` on functions #43302
Comments
aturon
added
B-RFC-approved
T-lang
labels
Jul 17, 2017
aturon
referenced this issue
Jul 17, 2017
Merged
Updated RFC #886 with lessons learned from #1812 #1940
Mark-Simulacrum
added
the
C-tracking-issue
label
Jul 27, 2017
This comment has been minimized.
This comment has been minimized.
|
I think I should have an implementation shortly. |
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 8, 2017
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 8, 2017
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 8, 2017
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 8, 2017
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 8, 2017
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 8, 2017
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 8, 2017
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 8, 2017
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 8, 2017
bors
added a commit
that referenced
this issue
Aug 9, 2017
bors
closed this
in
#43728
Aug 9, 2017
This comment has been minimized.
This comment has been minimized.
|
I'm just adding a note here that the current implementation of #1940 does not lint for unused In fact, the RFC itself states in the motivation
|
This comment has been minimized.
This comment has been minimized.
|
Yeah, that's a little awkward. I can add the comparison operators in a follow-on PR. |
This comment has been minimized.
This comment has been minimized.
|
Also, this issue shouldn't have been closed. Ahhh I may have not checked for a feature gate in the implementation. I'm a bad reviewer. |
eddyb
reopened this
Aug 9, 2017
zackmdavis
referenced this issue
Aug 9, 2017
Merged
feature-gate #[must_use] for functions as `fn_must_use` #43776
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 16, 2017
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 16, 2017
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 16, 2017
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 16, 2017
This comment has been minimized.
This comment has been minimized.
|
I have an implementation for linting |
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 16, 2017
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 16, 2017
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 16, 2017
This comment has been minimized.
This comment has been minimized.
|
Clippy has a correctness lint for that: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#unused_io_amount I don't think it can be caught by must_use, but a targeted lint can. |
This comment has been minimized.
This comment has been minimized.
Please, contribute your thoughts on #48926. |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Apr 1, 2018
|
|
rfcbot
added
final-comment-period
and removed
proposed-final-comment-period
labels
Apr 1, 2018
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Apr 11, 2018
|
The final comment period is now complete. |
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis: It looks like it was decided to stabilize this, can I assume that #48925 is now un-blocked? |
zackmdavis
referenced this issue
Apr 22, 2018
Merged
Added warning for unused arithmetic expressions #50149
This comment has been minimized.
This comment has been minimized.
|
@TimNN yep |
This comment has been minimized.
This comment has been minimized.
I'm confused about how exactly how literally we take our stability guarantee. This seems like it ought to be sheerly hypothetical—why would anyone have already written a program with such no-op attributes? But the |
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Apr 26, 2018
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Apr 26, 2018
This comment has been minimized.
This comment has been minimized.
This is the situation I was hoping to prevent, I didn’t realize it was already the case. |
This comment has been minimized.
This comment has been minimized.
|
We can make it a hard error on the next edition then. |
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Apr 28, 2018
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Apr 28, 2018
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Apr 29, 2018
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Apr 29, 2018
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
May 3, 2018
This comment has been minimized.
This comment has been minimized.
|
@aturon The stabilization PR has already gone through. I'm not sure if all the necessary docs are updated yet, although the reference has been. |
varkor
referenced this issue
May 23, 2018
Closed
Warn about potential no-op (result of non-mutating function being discarded). #1110
Centril
added
disposition-merge
finished-final-comment-period
and removed
final-comment-period
labels
May 24, 2018
This comment has been minimized.
This comment has been minimized.
|
@Havvy is there anything left here to do? |
This comment has been minimized.
This comment has been minimized.
|
I don't know. It's documented in the reference and there's an issue for the API guidelines book. But I don't think it's talked about in TRPL and definitely untouched in Rust By Example, if it should even be in there. |
This comment has been minimized.
This comment has been minimized.
|
Closing as completed. |
aturon commentedJul 17, 2017
•
edited by Centril
This is a tracking issue for the RFC "allow
#[must_use]on functions" (rust-lang/rfcs#1940).Steps: