Repository navigation
Document all unsafety used in libcore and libstd #66219
Copy link
Copy link
Closed
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
The repository still contains many instances of
// ignore-tidy-undocumented-unsafeWe should eliminate all of them by documenting the unsafe used in those files.
Documenting unsafe blocks works by adding a // SAFETY: comment infront of them explaining why the unsafe block is ok. If there is an explanation about the unsafety elsewhere in the file, you can also leave a // SAFETY: comment explaining that the overarching logic is explained elsewhere (and mention where, too!)
cc @Centril
not sure what labels to add to this issue.
See https://github.com/rust-lang/rust/pull/63793/files for examples and the introduction of the unsafety tidy check
Reacted by Jacob Pratt, chansuke, ratijas and scottmcm
Reacted by Mazdak Farrokhzad, Christopher Serr, chansuke, ratijas and troublescooter
Metadata
Metadata
Assignees
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Activity
foeb commentedon Nov 9, 2019
Hi! I'm interested in working on this.
foeb commentedon Nov 9, 2019
@rustbot claim
rust-lang#66219 documented unsafe in core::sync::atomic
rust-lang#66219 documented unsafe in core::str
rust-lang#66219 documented unsafe in core::cell
rust-lang#66219 documented unsafe in core::{cell, hint, panic}
rust-lang#66219 documented unsafe in core::{alloc, hash}
35 remaining items
Document unsafety in core::slice::memchr
Auto merge of rust-lang#76688 - yokodake:patch-2, r=kodrAus
poliorcetics commentedon Jul 14, 2021
With #87127, only some
unsafeblocks insrc/libcore/slice/sort.rsare left. I looked them over and I don't think I understand the algorithm well enough to make aSAFETYcomment for them thoughRollup merge of rust-lang#87127 - poliorcetics:ptr-rotate-safety, r=s…
Rollup merge of rust-lang#87127 - poliorcetics:ptr-rotate-safety, r=s…
Rollup merge of rust-lang#87127 - poliorcetics:ptr-rotate-safety, r=s…
Rollup merge of rust-lang#88291 - mdsn:partition-in-blocks-safety, r=…
Rollup merge of rust-lang#88412 - mdsn:slice-sort-safety, r=dtolnay
Rollup merge of rust-lang#88412 - mdsn:slice-sort-safety, r=dtolnay
mdsn commentedon Sep 30, 2021
With #88412 merged I believe libstd is now free of
// ignore-tidy-undocumented-unsafewhich means this issue might be done.