-
Notifications
You must be signed in to change notification settings - Fork 13.4k
add warning sign to UB examples #72431
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @shepmaster (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And do we care about
@@ -553,7 +553,7 @@ impl<T> MaybeUninit<T> { | |||
/// x.write(Some(vec![0,1,2])); | |||
/// let x1 = unsafe { x.read() }; | |||
/// let x2 = unsafe { x.read() }; | |||
/// // We now created two copies of the same vector, leading to a double-free when | |||
/// // We now created two copies of the same vector, leading to a double-free ⚠️ when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear, this ⚠︎ is supposed to be in the middle of the sentence, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the warning sign next to the "dangerous noun". But if you think it'd be better to move it to the end of the sentence I can do that, too.
r=me if my questions were what you intended. |
Only one of the two symbols there is an actual uniode emoji, the other is whatever GH uses for emojis it seems... This is how the one I used renders: https://doc.rust-lang.org/nightly/std/slice/fn.from_raw_parts.html#incorrect-usage |
⚠︎
|
@bors r+ rollup |
📌 Commit 80ab025f24be752a01c0fc107b5391afb68ab766 has been approved by |
Oh I see. I think I'll make them all yellow then. :) |
Hm I cannot copy-paste the colored one, that's weird. |
Hm, I cannot figure out how to get the emoji variant into a file. @bors r=shepmaster |
📌 Commit 1c9b96b has been approved by |
add warning sign to UB examples Just to make it less likely that people miss the fact that these are examples for how to *not* do it.
add warning sign to UB examples Just to make it less likely that people miss the fact that these are examples for how to *not* do it.
add warning sign to UB examples Just to make it less likely that people miss the fact that these are examples for how to *not* do it.
Rollup of 5 pull requests Successful merges: - rust-lang#72292 (Replace obligation construction with deref_steps()) - rust-lang#72431 (add warning sign to UB examples) - rust-lang#72446 (Impl Ord for proc_macro::LineColumn) - rust-lang#72492 (Add some regression tests) - rust-lang#72496 (Correct small typo: 'not' -> 'note') Failed merges: r? @ghost
Just to make it less likely that people miss the fact that these are examples for how to not do it.