Skip to content

Add #[must_use] annotations #268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 28, 2021

Conversation

matthiasbeyer
Copy link
Member

Clippy nightly fails the checks because it wants us to have a
#[must_use] annotation on functions that return Self.

So we add these annotations with this patch.


@danieleades I'm not sure whether you included this in your patchsets somewhere... 😆

Clippy nightly fails the checks because it wants us to have a
`#[must_use]` annotation on functions that return `Self`.

So we add these annotations with this patch.

Signed-off-by: Matthias Beyer <[email protected]>
@danieleades
Copy link
Contributor

they're included in #262

note that i've made the types themselves must_use rather than the methods since this is appropriate for 'builder' structs. There is currently a false positive in clippy where the must_use suggestion fails to take into account that the type is must_use. see rust-lang/rust-clippy#8140

@matthiasbeyer
Copy link
Member Author

@danieleades sorry if this is already included in your patchsets somewhere... I'll merge this because it makes CI happy right now, not because I don't like your work, okay? 😆 ❤️

@matthiasbeyer matthiasbeyer merged commit 9aa13c6 into rust-cli:master Dec 28, 2021
@matthiasbeyer matthiasbeyer deleted the fix-nightly-clippy branch December 28, 2021 18:21
@matthiasbeyer
Copy link
Member Author

Ah, sorry, didn't see your comment before posting mine! Feel free to suggest any changes you see fit, of course!

@danieleades
Copy link
Contributor

Ah, sorry, didn't see your comment before posting mine! Feel free to suggest any changes you see fit, of course!

how about i open a PR to move the must_use attributes to the type, rather than the methods, and then leave it as a draft until clippy is fixed upstream and the jobs pass?

@matthiasbeyer
Copy link
Member Author

Good idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants