experiment: Require safety comments in all of std & alloc - #160824
Conversation
|
We have CODEOWNERS? |
|
we have configs for teams to get pinged when certain files are touched. close enough |
|
I think, for the sake of this being reasonable to merge at all, we should probably split this into multiple pieces. Also, perhaps starting with alloc would be best? |
|
|
|
I feel like offering up a PR with just
|
There was a problem hiding this comment.
This file is generated from windows-bindgen so shouldn't be edited. But the good news is that, since Default is now implemented on pointers, the unsafe will be going away in the next version of windows-bindgen.
| // Safety: We only touch lock_count when we own the inner mutex. | ||
| // Additionally, we only call `self.owner.set()` while holding | ||
| // the inner mutex, so no two threads can call it concurrently. | ||
| // SAFETY: Untriaged. |
There was a problem hiding this comment.
Two safety comments here now
There was a problem hiding this comment.
fair. I did all of this with just a regex, not intending to merge as-is ^^ there's very likely a lot of cases like this
| _ => { | ||
| // SAFETY: Untriaged. | ||
| unsafe { | ||
| cvt(libc::pipe(fds.as_mut_ptr()))?; | ||
|
|
There was a problem hiding this comment.
Formatting seems a little off here
There was a problem hiding this comment.
This is an unfortunate side-effect of macro formatting; not even indenting gets done right.
|
☔ The latest upstream changes (presumably #160954) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
…nthey doc: document safety requirements for core WTF-8 This PR is a follow-up to rust-lang#160824, and serves as a complementry of `Wtf8` in `alloc` . This PR currently fixes the wtf8 module in `core`, because I noticed that some unsafe APIs in this file do not provide a `safety section`. Therefore, before discharging the call sites, we need to first add the safety section. This PR performs that fix. This PR is related to unstable feature `Wtf8` but this feature don't have relevant tracking issue.
…nthey doc: document safety requirements for core WTF-8 This PR is a follow-up to rust-lang#160824, and serves as a complementry of `Wtf8` in `alloc` . This PR currently fixes the wtf8 module in `core`, because I noticed that some unsafe APIs in this file do not provide a `safety section`. Therefore, before discharging the call sites, we need to first add the safety section. This PR performs that fix. This PR is related to unstable feature `Wtf8` but this feature don't have relevant tracking issue.
…nthey doc: document safety requirements for core WTF-8 This PR is a follow-up to rust-lang#160824, and serves as a complementry of `Wtf8` in `alloc` . This PR currently fixes the wtf8 module in `core`, because I noticed that some unsafe APIs in this file do not provide a `safety section`. Therefore, before discharging the call sites, we need to first add the safety section. This PR performs that fix. This PR is related to unstable feature `Wtf8` but this feature don't have relevant tracking issue.
Rollup merge of #161271 - yilin0518:fix_coree_wtf8, r=clarfonthey doc: document safety requirements for core WTF-8 This PR is a follow-up to #160824, and serves as a complementry of `Wtf8` in `alloc` . This PR currently fixes the wtf8 module in `core`, because I noticed that some unsafe APIs in this file do not provide a `safety section`. Therefore, before discharging the call sites, we need to first add the safety section. This PR performs that fix. This PR is related to unstable feature `Wtf8` but this feature don't have relevant tracking issue.
…nthey Add safety comments in alloc::Wtf8 This PR follow up rust-lang#160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in rust-lang#160824. Before this PR, rust-lang#161271 had add some safety sections for Wtf8 in core. I'm looking forward to your review and give me any feedback to improve this PR.
…nthey Add safety comments in alloc::Wtf8 This PR follow up rust-lang#160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in rust-lang#160824. Before this PR, rust-lang#161271 had add some safety sections for Wtf8 in core. I'm looking forward to your review and give me any feedback to improve this PR.
…nthey Add safety comments in alloc::Wtf8 This PR follow up rust-lang#160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in rust-lang#160824. Before this PR, rust-lang#161271 had add some safety sections for Wtf8 in core. I'm looking forward to your review and give me any feedback to improve this PR.
…nthey Add safety comments in alloc::Wtf8 This PR follow up rust-lang#160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in rust-lang#160824. Before this PR, rust-lang#161271 had add some safety sections for Wtf8 in core. I'm looking forward to your review and give me any feedback to improve this PR.
…nthey Add safety comments in alloc::Wtf8 This PR follow up rust-lang#160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in rust-lang#160824. Before this PR, rust-lang#161271 had add some safety sections for Wtf8 in core. I'm looking forward to your review and give me any feedback to improve this PR.
…nthey Add safety comments in alloc::Wtf8 This PR follow up rust-lang#160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in rust-lang#160824. Before this PR, rust-lang#161271 had add some safety sections for Wtf8 in core. I'm looking forward to your review and give me any feedback to improve this PR.
…nthey Add safety comments in alloc::Wtf8 This PR follow up rust-lang#160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in rust-lang#160824. Before this PR, rust-lang#161271 had add some safety sections for Wtf8 in core. I'm looking forward to your review and give me any feedback to improve this PR.
…nthey Add safety comments in alloc::Wtf8 This PR follow up rust-lang#160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in rust-lang#160824. Before this PR, rust-lang#161271 had add some safety sections for Wtf8 in core. I'm looking forward to your review and give me any feedback to improve this PR.
Rollup merge of #161292 - yilin0518:fix_alloc_wtf8, r=clarfonthey Add safety comments in alloc::Wtf8 This PR follow up #160824 and add some safety section for unsafe APIs. This PR focus on Wtf8 in alloc and fix every `Untriged` mentioned in #160824. Before this PR, #161271 had add some safety sections for Wtf8 in core. I'm looking forward to your review and give me any feedback to improve this PR.
doc: document safety requirements for core WTF-8 This PR is a follow-up to rust-lang/rust#160824, and serves as a complementry of `Wtf8` in `alloc` . This PR currently fixes the wtf8 module in `core`, because I noticed that some unsafe APIs in this file do not provide a `safety section`. Therefore, before discharging the call sites, we need to first add the safety section. This PR performs that fix. This PR is related to unstable feature `Wtf8` but this feature don't have relevant tracking issue.
cc @workingjubilee @joshtriplett, per discussion in Zulip.
this is... awful, but not as awful as expected :D it'd also cause a lot of conflicts. i'm scared of how many
CODEOWNERSmight be triggered