-
Notifications
You must be signed in to change notification settings - Fork 180
Annotate all unsafe blocks with a safety comment and prevent regressions #429
Copy link
Copy link
Open
Labels
compatibility-nonbreakingChanges that are (likely to be) non-breakingChanges that are (likely to be) non-breakingexperience-easyThis issue is easy, and shouldn't require much experienceThis issue is easy, and shouldn't require much experienceexperience-hardThis issue is hard, and requires a lot of experienceThis issue is hard, and requires a lot of experienceexperience-mediumThis issue is of medium difficulty, and requires some experienceThis issue is of medium difficulty, and requires some experiencehelp wantedExtra attention is neededExtra attention is needed
Description
Activity
Metadata
Metadata
Assignees
Labels
compatibility-nonbreakingChanges that are (likely to be) non-breakingChanges that are (likely to be) non-breakingexperience-easyThis issue is easy, and shouldn't require much experienceThis issue is easy, and shouldn't require much experienceexperience-hardThis issue is hard, and requires a lot of experienceThis issue is hard, and requires a lot of experienceexperience-mediumThis issue is of medium difficulty, and requires some experienceThis issue is of medium difficulty, and requires some experiencehelp wantedExtra attention is neededExtra attention is needed
As part of #61, we need to make sure that all
unsafecode is proven to be sound. Currently, allunsafecode is either documented with a safety comment (// SAFETY: ...), or is marked with a TODO that references this issue. Our goal is to reach 100% safety comment coverage, and to not regress once we've reached 100%. To that end, we enforce theclippy::undocumented_unsafe_blockslint to prevent regressions.A note on linting: It'd be nice to be able to replace the top-level
#![deny(clippy::undocumented_unsafe_blocks)]with aforbidonce all TODOs are burned down, but unfortunately oursafety_comment!macro relies on the ability to use#[allow(clippy::undocumented_unsafe_blocks)], so we have to settle for a deny.In order to ensure that our soundness is forwards-compatible, safety comments must satisfy the following criteria:
Mentoring instructions
TODO(#429)in a comment; leave a GitHub comment on this issue to claim that instance to avoid duplicated work. Write a safety comment that abides by the requirements listed above.Feel free to ask for help here if you're stuck or have questions!
List of suggested safety comments
List
This list contains safety comments which are good starter safety comments if you're not already familiar with writing them.
zerocopy/src/lib.rs
Lines 757 to 767 in f001cf2
zerocopy/src/lib.rs
Lines 757 to 767 in f001cf2