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

Mark C function return values as #[must_use] #451

Closed
briansmith opened this issue Feb 7, 2017 · 1 comment
Closed

Mark C function return values as #[must_use] #451

briansmith opened this issue Feb 7, 2017 · 1 comment

Comments

@briansmith
Copy link
Owner

One approach is to use (if/when it is implemented) the proposed #[must_use] annotation on functions: rust-lang/rfcs#886.

Another approach is to change the return value to a #[repr(transparent)] wrapper that is marked #[must_use], if/when this proposal is implemented: rust-lang/rfcs#1758.

This is a good-first-bug since this is something anybody can do, once the facilities are available to actually do it, but note that it requires additional work on rustc.

@briansmith
Copy link
Owner Author

The Rust feature #[must_use] has been implemented: rust-lang/rust#43302. The #[repr(transparent)] idea seems better to me, though; that's rust-lang/rust#43036.

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

No branches or pull requests

1 participant