Skip to content

Consider adding #[must_use] annotation to some types, functions, and macros #188

New issue

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

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

Already on GitHub? # to your account

Closed
joshlf opened this issue Jun 2, 2023 · 0 comments · Fixed by #1003
Closed

Consider adding #[must_use] annotation to some types, functions, and macros #188

joshlf opened this issue Jun 2, 2023 · 0 comments · Fixed by #1003
Labels
compatibility-breaking Changes that are (likely to be) breaking

Comments

@joshlf
Copy link
Member

joshlf commented Jun 2, 2023

The functions that probably need this the most are the write_to_xxx methods. These return an Option<()>, and so it'd be easy to call write_to_xxx, ignore this return value, and assume that the write had unconditionally succeeded (or assume that, as is often the case in Rust APIs, the method will panic on failure.

We should also use #[must_use] in transmute!, transmute_ref!, and transmute_mut!, as they are side effect-free.

See also #284

@joshlf joshlf added blocking-next-release This issue should be resolved before we release on crates.io compatibility-breaking Changes that are (likely to be) breaking and removed blocking-next-release This issue should be resolved before we release on crates.io labels Aug 9, 2023
@joshlf joshlf changed the title Consider adding #[must_use] annotation to some types and functions Consider adding #[must_use] annotation to some types, functions, and macros Nov 2, 2023
@joshlf joshlf mentioned this issue Dec 4, 2023
87 tasks
joshlf added a commit that referenced this issue Mar 2, 2024
Add Clippy lints to help prevent regressions.

Closes #188
joshlf added a commit that referenced this issue Mar 2, 2024
Add Clippy lints to help prevent regressions.

Closes #188
github-merge-queue bot pushed a commit that referenced this issue Mar 2, 2024
Add Clippy lints to help prevent regressions.

Closes #188
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
compatibility-breaking Changes that are (likely to be) breaking
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant