Skip to content
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

Extend #[must_use] to more types #73417

Open
tmandry opened this issue Jun 16, 2020 · 2 comments
Open

Extend #[must_use] to more types #73417

tmandry opened this issue Jun 16, 2020 · 2 comments
Labels
A-async-await Area: Async & Await AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@tmandry
Copy link
Member

tmandry commented Jun 16, 2020

In particular, we should add #[must_use] to these "wrapper" types in the standard library:

Both would be conditioned on whether T was #[must_use].

@tmandry tmandry added A-async-await Area: Async & Await AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. labels Jun 16, 2020
@Jasperav
Copy link

I support this! Furthermore, I like having must_have being the default. Explicitly opting out using the return value would IMO better, just like the way Swift is handling return values.

@tmandry
Copy link
Member Author

tmandry commented Jun 16, 2020

This issue is only about adding #[must_use] to more "wrapper" types in the standard library and conditioning it on whether their type parameter is must_use. I'll update the description to make it more clear.

@tmandry tmandry added T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-async-await Area: Async & Await AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants