Closed
Description
Current Stacked Borrows makes this UB:
fn main() { unsafe {
let x = &0usize;
let y: &std::cell::Cell<usize> = std::mem::transmute(x);
} }
To be honest I do not think there is a good reason for this. We cannot optimize much around interior mutable types, so I don't think we should require them to be writable unless we are actually mutating.