Skip to content

Conversation

Havvy
Copy link
Contributor

@Havvy Havvy commented Sep 13, 2017

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

@rust-highfive
Copy link
Contributor

r? @sfackler

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

Copy link
Contributor

@strega-nil strega-nil 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 to me 👍

thanks @Havvy

/// // the original inner type (`&i32`) to the converted inner type
/// // (`Option<&i32>`), so read the nomicon pages linked above.
/// let v_from_raw = unsafe {
/// Vec::from_raw_parts(v_orig.as_mut_ptr(),
/// Vec::from_raw_parts(v_orig.as_mut_ptr() as *mut Option<&T>,
Copy link
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
Contributor Author

Choose a reason for hiding this comment

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

🤦‍♂️ fixed

@steveklabnik
Copy link
Contributor

@bors: r+ rollup

thanks!

@bors
Copy link
Collaborator

bors commented Sep 13, 2017

📌 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.
@aidanhs aidanhs 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.
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.
bors added a commit that referenced this pull request Sep 15, 2017
@bors bors merged commit 9dd2ee1 into rust-lang:master Sep 15, 2017
@Havvy Havvy deleted the transmute-docs branch September 18, 2017 08:00
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.

8 participants