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

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 AsyncAwait-Triaged T-lang T-libs-api

Comments

@tmandry
Copy link
Contributor

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 AsyncAwait-Triaged labels Jun 16, 2020
@tmandry tmandry added this to On deck in wg-async work via automation Jun 16, 2020
@Jasperav
Copy link

Jasperav commented Jun 16, 2020

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
Contributor 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 removed this from On deck in wg-async work Jul 14, 2020
@tmandry tmandry added T-lang T-libs-api 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 AsyncAwait-Triaged T-lang T-libs-api
Projects
None yet
Development

No branches or pull requests

2 participants