Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Forbid unsafe code #3

Closed
wants to merge 1 commit into from
Closed

Conversation

Shnatsel
Copy link

@Shnatsel Shnatsel commented Jul 4, 2020

Add #![forbid(unsafe_code)] directive to crate root. This makes the compiler verify that there is indeed no unsafe code in the crate, which aids analysis and makes output of tools such as cargo geiger more reliable.

@jonas-schievink
Copy link
Owner

This will conflict with #2, which I intend to merge

@Shnatsel
Copy link
Author

Shnatsel commented Jul 4, 2020

Ah, hmm. Yeah, #2 looks good. I can't think of a safe way to do that with minimal depedencies. zerocopy crate sure can but it will pull in syn. https://crates.io/crates/bytemuck on the other hand doesn't have a custom derive; it can be done without proc macros, but the complexity is probably not worth it.

@matklad
Copy link

matklad commented Jul 10, 2020

For future archeologists, forbid(unsafe) was added in 6caed1f#diff-b4aea3e418ccdb71239b96952d9cddb6R15

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

Successfully merging this pull request may close these issues.

3 participants