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

Forbid unsafe_code #294

Merged
merged 1 commit into from Jan 31, 2023
Merged

Forbid unsafe_code #294

merged 1 commit into from Jan 31, 2023

Conversation

fintelia
Copy link
Contributor

@fintelia fintelia commented Jan 2, 2023

Fixes #222. Contrary to what is mentioned there, removing this annotation would not constitute a breaking change requiring a major version bump (at least according to normal Rust conventions). It is merely an assertion that the current patch release contains no unsafe code.

Looking for #![forbid(unsafe_code)] is more reliable than trying to grep the crate source code for instances of "unsafe", since the latter could hypothetically be concealed by macros and such.

Copy link
Member

@KodrAus KodrAus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fintelia 👍 I think this is something I'd be comfortable doing now. My comment about major version bumps was less about semver compatibility and more about making a reasonable commitment to users who care about the presence of unsafe code in their dependencies. You certainly should expect unsafe code to appear or disappear in patches, but I see #[forbid(unsafe_code)] also as a design guideline to avoid any solutions that require unsafe code.

@KodrAus KodrAus merged commit 5b36ce5 into bitflags:main Jan 31, 2023
@fintelia fintelia deleted the forbid-unsafe branch January 31, 2023 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

forbid unsafe_code in the library code?
2 participants