Location (URL)
https://doc.rust-lang.org/std/mem/fn.transmute.html
Summary
transmute docs mention rvalues in a comment in the last example. This should instead be called a value or just not named.
E.g. the comment could be
// This now has three mutable references pointing at the same
// memory: `slice`, `returned.0` and `returned.1`.
// `slice` is never used after `let ptr = ...`, and so one can
// treat it as "dead", and therefore, you only have two real
// mutable slices.
maybe a better way of writing it would be:
unsafe {
let ptr = slice.as_mut_ptr();
// This now has three mutable references pointing at the same
// memory: `slice`, `ret.0` and `ret.1`. `slice` is never used after
// `let ptr = ...`, and so one can treat it as "dead", and therefore,
// you only have two real mutable slices.
let ret = (slice::from_raw_parts_mut(ptr, mid),
slice::from_raw_parts_mut(ptr.add(mid), len - mid))
ret
}
Location (URL)
https://doc.rust-lang.org/std/mem/fn.transmute.html
Summary
transmute docs mention rvalues in a comment in the last example. This should instead be called a value or just not named.
E.g. the comment could be
maybe a better way of writing it would be: