Skip to content

Fix example in transmute; add safety requirement to Vec::from_raw_parts - #44536

Merged
bors merged 1 commit into
rust-lang:masterfrom
Havvy:transmute-docs
Sep 15, 2017
Merged

Fix example in transmute; add safety requirement to Vec::from_raw_parts#44536
bors merged 1 commit into
rust-lang:masterfrom
Havvy:transmute-docs

Conversation

@Havvy

Copy link
Copy Markdown
Contributor

This fixes the second bullet point on #44281 and also removes some incorrect information.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @sfackler

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

@strega-nilstrega-nil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good to me 👍

thanks @Havvy

Comment threadsrc/libcore/intrinsics.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You mean as *mut Option<&i32> here?

[01:05:15] ---- intrinsics.rs - intrinsics::transmute (line 837) stdout ----
[01:05:15] error[E0412]: cannot find type `T` in this scope
[01:05:15] --> intrinsics.rs:29:61
[01:05:15] |
[01:05:15] 29 | Vec::from_raw_parts(v_orig.as_mut_ptr() as *mut Option<&T>,
[01:05:15] | ^ not found in this scope

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

🤦‍♂️ fixed

@steveklabnik

Copy link
Copy Markdown
Contributor

@bors: r+ rollup

thanks!

@bors

bors commented Sep 13, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit 9dd2ee1 has been approved by steveklabnik

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 13, 2017
Fix example in transmute; add safety requirement to Vec::from_raw_parts
This fixes the second bullet point on rust-lang#44281 and also removes some incorrect information.
@aidanhsaidanhs added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Sep 13, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Sep 14, 2017
Fix example in transmute; add safety requirement to Vec::from_raw_parts
This fixes the second bullet point on rust-lang#44281 and also removes some incorrect information.
@frewsxcvfrewsxcv mentioned this pull request Sep 14, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Sep 15, 2017
Fix example in transmute; add safety requirement to Vec::from_raw_parts
This fixes the second bullet point on rust-lang#44281 and also removes some incorrect information.
@frewsxcvfrewsxcv mentioned this pull request Sep 15, 2017
bors added a commit that referenced this pull request Sep 15, 2017
@bors
bors merged commit 9dd2ee1 into rust-lang:masterSep 15, 2017
@Havvy
Havvy deleted the transmute-docs branch September 18, 2017 08:00
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: 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.

8 participants

@Havvy@rust-highfive@steveklabnik@bors@kennytm@strega-nil@aidanhs@sfackler