Enforce safety comments on alloc - #160941
Conversation
|
This will break a lot of ppl's CI ^^ @bors rollup=never |
|
I'm not convinced |
|
@bors rollup=iffy p=1 likely to soft conflict |
|
...i completely forgot to actually push the commit with all my manual work. apologies 🫠 |
|
Oh, I didn't know that you were actually going through and adding comments to these. I'd, probably want to do an actual review in that case. |
| type Cap = core::num::niche_types::UsizeNoHighBit; | ||
|
|
||
| // SAFETY: Untriaged. | ||
| // SAFETY: 0 *definitely* is less than isize::MAX. |
There was a problem hiding this comment.
But how can you be sure?
There was a problem hiding this comment.
easy: isize was defined before 2025 and therefore there were affordable computers around that had to address more than 0 bytes of memory!
| // SAFETY: Precondition passed to caller | ||
| // SAFETY: Untriaged. | ||
| if let Some((ptr, layout)) = unsafe { self.current_memory(elem_layout) } { | ||
| // SAFETY: Untriaged. | ||
| // SAFETY: Precondition passed to caller |
There was a problem hiding this comment.
This one looked painful to figure out
| fn into_inner_with_allocator(this: Self) -> (NonNull<ArcInner<T>>, A) { | ||
| let this = mem::ManuallyDrop::new(this); | ||
| // SAFETY: Untriaged. | ||
| // SAFETY: Pointer is valid for reads and won't be double-dropped. |
There was a problem hiding this comment.
YORO? (You only read once.)
|
Could you put a |
|
|
|
that should address review comments 🫠 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
it seems my children have come to haunt me |
0ad4d08 to
0c8e275
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
safety comments in alloc this was pain and it's not even half i think oepsje woepsje
0c8e275 to
2120557
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
per this week's libs meeting, we (a) do want this! and (b) we should go for ignore-tidy-undocumented-unsafe instead of a blank untriaged comment |
View all comments
cc @clarfonthey, @workingjubilee. Following up from #160824. I spent a painfully long time going over the comments and ensuring there's nothing too awful ^^
r? clarfonthey