- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Fix example in transmute; add safety requirement to Vec::from_raw_parts #44536
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
Conversation
| r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) | 
There was a problem hiding this 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
        
          
                src/libcore/intrinsics.rs
              
                Outdated
          
        
      There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️ fixed
e069039    to
    1d04254      
    Compare
  
    1d04254    to
    9dd2ee1      
    Compare
  
    | @bors: r+ rollup thanks! | 
| 📌 Commit 9dd2ee1 has been approved by  | 
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.
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.
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.
This fixes the second bullet point on #44281 and also removes some incorrect information.