-
Notifications
You must be signed in to change notification settings - Fork 461
must_use attribute #646
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
Comments
Because Before I'd be willing to do this, I'd really need a more thorough proposal than this. In particular, what are the downsides of |
The most common place where I've seen I think the key missing piece of the equation for me is, "what are the down sides of using |
This is IMO a bit strange, because the Result type already has a #[must_use] attribute. As far as i know there are no downsides when adding a must_use tag. (Obviously its a bit of work to annotate functions with it). But its indeed strange that it is not used more widely. The tracking issue for annotating more functions in the standard library with it is rust-lang/rust#48926 |
Yes, that's what I meant? Anyway, thank you for linking to that issue. It led me to this thread. In particular, I pretty much agree with what withoutboats said:
If std winds up adopting a liberal policy of using |
Is there a reason why the must_use attribute is not used on functions that return a Boolean, for example "is_match" ? It could help to catch errors when the return value accidentally is unused
The text was updated successfully, but these errors were encountered: