Skip to content
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

Merged
merged 3 commits into from
Aug 6, 2019
Merged

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Aug 5, 2019

We have this warning in the type-level docs, but it seems worth repeating it on the function.

@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 5, 2019
@Mark-Simulacrum
Copy link
Member

r=me either way

Copy link
Contributor

@Centril Centril left a 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 ;)

@RalfJung
Copy link
Member Author

RalfJung commented Aug 6, 2019

@bors r=Mark-Simulacrum,Centril rollup

@bors
Copy link
Contributor

bors commented Aug 6, 2019

📌 Commit 1b9eb4a has been approved by Mark-Simulacrum,Centril

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 6, 2019
@@ -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
Copy link

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".

Copy link
Contributor

@Centril Centril Aug 6, 2019

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".

Copy link
Member Author

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 ;

@RalfJung
Copy link
Member Author

RalfJung commented Aug 6, 2019

@bors r=Mark-Simulacrum,Centril

@bors
Copy link
Contributor

bors commented Aug 6, 2019

📌 Commit 1821414 has been approved by Mark-Simulacrum,Centril

Centril added a commit to Centril/rust that referenced this pull request Aug 6, 2019
…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.
Centril added a commit to Centril/rust that referenced this pull request Aug 6, 2019
…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.
bors added a commit that referenced this pull request Aug 6, 2019
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
@bors bors merged commit 1821414 into rust-lang:master Aug 6, 2019
@RalfJung RalfJung deleted the assume_init branch August 9, 2019 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants