assume_init: warn about valid != safe#63298
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
r=me either way |
Centril
left a comment
There was a problem hiding this comment.
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
| /// | ||
| /// 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.
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.
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".
|
@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.