]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #43728 - zackmdavis:fnused, r=eddyb
authorbors <bors@rust-lang.org>
Wed, 9 Aug 2017 04:03:49 +0000 (04:03 +0000)
committerbors <bors@rust-lang.org>
Wed, 9 Aug 2017 04:03:49 +0000 (04:03 +0000)
#[must_use] for functions

This implements [RFC 1940](https://github.com/rust-lang/rfcs/pull/1940).

The RFC and discussion thereof seem to suggest that tagging `PartialEq::eq` and friends as `#[must_use]` would automatically lint for unused comparisons, but it doesn't work out that way (at least the way I've implemented it): unused `.eq` method calls get linted, but not `==` expressions. (The lint operates on the HIR, which sees binary operations as their own thing, even if they ultimately just call `.eq` _&c._.)

What do _you_ think??

Resolves #43302.


Trivial merge