Skip to content

vastly expand on the mem::uninitialized docs #27488

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

Merged
merged 1 commit into from
Aug 3, 2015

Conversation

Gankra
Copy link
Contributor

@Gankra Gankra commented Aug 3, 2015

Inspired by #27484

@rust-highfive
Copy link
Contributor

r? @brson

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

@Gankra Gankra force-pushed the uninit-docs branch 2 times, most recently from c7f41fe to e060ef6 Compare August 3, 2015 05:12
/// allocation:
///
/// ```
/// let data = vec![Vec::new(); 1000];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't compile since the element type can't be inferred.

oh, I just noticed travis also found that...

@Gankra
Copy link
Contributor Author

Gankra commented Aug 3, 2015

Comments adressed.

@bluss
Copy link
Member

bluss commented Aug 3, 2015

Thanks, I like the explicit code example. We need to hammer in the panic safety issue since it's easy to produce panic unsafe code without ever running into the crashing / UB cases in practice.

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 3, 2015

📌 Commit 5e6973d has been approved by bluss

@bors
Copy link
Collaborator

bors commented Aug 3, 2015

⌛ Testing commit 5e6973d with merge 76ba3f0...

bors added a commit that referenced this pull request Aug 3, 2015
/// ```
///
/// Hopefully this example emphasizes to you exactly how delicate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The beginning of this sentence sounds a lot like an attempt to appeal to one’s conscience/morality. Dropping the “Hopefully” and “to you” would make this sound much more professional IMO.

This example emphasizes exactly how delicate and dangerous this function is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

@Gankra
Copy link
Contributor Author

Gankra commented Aug 3, 2015

@nagisa this is already being built in the queue -- either of us can submit an amendment if it doesn't bounce.

@nagisa
Copy link
Member

nagisa commented Aug 3, 2015

Sure. Sorry I didn’t come around this earlier.

@Gankra
Copy link
Contributor Author

Gankra commented Aug 3, 2015

No worries! Empty queues make things frustrating sometimes. 😓

@bors bors merged commit 5e6973d into rust-lang:master Aug 3, 2015
nagisa added a commit to nagisa/rust that referenced this pull request Aug 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants