mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
@@ -882,7 +882,7 @@
|
||||
/// let v_clone = v_orig.clone();
|
||||
///
|
||||
/// // Using transmute: this relies on the unspecified data layout of `Vec`, which is a
|
||||
/// // bad idea and could cause Undefined Behavior
|
||||
/// // bad idea and could cause Undefined Behavior.
|
||||
/// // However, it is no-copy.
|
||||
/// let v_transmuted = unsafe {
|
||||
/// std::mem::transmute::<Vec<&i32>, Vec<Option<&i32>>>(v_clone)
|
||||
|
||||
Reference in New Issue
Block a user