-
Notifications
You must be signed in to change notification settings - Fork 13.3k
tuples containing #[must_use] types should be #[must_use] #61061
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
@joshtriplett suggested that we test this out with crater to see if this would generate much substantial noise and how common it would be. |
I'd expect it'd be a pretty substantial source of warnings, but that's exactly why I think we should introduce it. People compiling with In any case, running crater would require having an implementation to do a crater run on, so let's do it! |
Let's do it. (I'd personally even like an attribute to allow people to opt-in to this for |
I've opened a pull request to try this out: #61100. |
We discussed this on the language team meeting; folks felt generally positive, but we'd like to do a crater run to see what the impact would be like and if there would be many false positives. |
Apply #[must_use] lint to components of tuples Fixes #61061.
Apply #[must_use] lint to components of tuples Fixes #61061.
I tried this using struct A;
#[must_use]
struct B;
fn t() -> (A, B) {
(A, B)
}
fn main() {
let (a, _b) = t();
} I hit this when doing https://docs.rs/hyper/0.14.7/hyper/client/conn/struct.Builder.html#method.handshake where I didn't use |
@pickfire putting it into a binding, even an unused one, is considered a use, like how |
gives a warning, but
does not.
The text was updated successfully, but these errors were encountered: