-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assume_init: warn about valid != safe #63298
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
r=me either way |
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.
Looks good with the latest set of weasel words ;)
@bors r=Mark-Simulacrum,Centril rollup |
📌 Commit 1b9eb4a has been approved by |
src/libcore/mem/maybe_uninit.rs
Outdated
@@ -402,6 +403,14 @@ impl<T> MaybeUninit<T> { | |||
/// | |||
/// [inv]: #initialization-invariant | |||
/// | |||
/// On top of that, remember that most types have additional invariants beyond merely | |||
/// being considered initialized at the type level. For example, a `1`-initialized [`Vec<T>`] | |||
/// is considered initialized (under the current implementation, this does not constitute |
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.
Grammatical note: there are two possible interpretations with the comma here. If you change the comma to a semicolon ;
or double dash --
, is it the meaning you intended? If so, it will be better to change it. If not, it will be better to rephrase.
Another option is to drop the "this does not constitute a stable guarantee" part of the sentence because it is redundant with "under the current implementation".
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.
Another option is to drop the "this does not constitute a stable guarantee" part of the sentence because it is redundant with "under the current implementation".
It's not redundant; it is making the point that the current implementation is not a stable guarantee, but I'd rephrase as: "under the current implementation, which does not constitute a stable guarantee".
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.
@bluetech thanks! Turned it into a ;
@bors r=Mark-Simulacrum,Centril |
📌 Commit 1821414 has been approved by |
…crum,Centril assume_init: warn about valid != safe We have this warning in the type-level docs, but it seems worth repeating it on the function.
…crum,Centril assume_init: warn about valid != safe We have this warning in the type-level docs, but it seems worth repeating it on the function.
Rollup of 6 pull requests Successful merges: - #62459 (Use internal iteration in the Sum and Product impls of Result and Option) - #62821 (Not listed methods) - #62837 (Fix theme picker blur handler: always hide instead of switching) - #63286 (Replace error callback with Result) - #63296 (Deduplicate rustc_demangle in librustc_codegen_llvm) - #63298 (assume_init: warn about valid != safe) Failed merges: r? @ghost
We have this warning in the type-level docs, but it seems worth repeating it on the function.