This is undefined behaviour, and so would preferably be avoided by using Unsafe etc.
#13934 removed the transmute_mut function, replacing it with (closer to) correct code where possible & transmute::<&_, &mut where not possible (that code snippet is the longest sequence that means grep will find all of the calls I inserted). There's fixmes pointing to this issue too.