4 ms·
Oh, yes, HN replaced * with italics. I was talking about raw pointers, i.e. the second example is: f(&mut x as *mut u8, &mut x) and there is no dynamic bo
by dbaupp 13y ago
Oh, yes, HN replaced * with italics. I was talking about raw pointers, i.e. the second example is:
f(&mut x as *mut u8, &mut x)
and there is no dynamic borrowing checking for that.
Would it become some form of undefined behaviour to have an *mut aliasing with an &mut?
- pcwalton 13y agoNah, I think we can handle it without undefined behavior by telling LLVM that `﹡mut` can alias anything. In effect, we would only tell LLVM that `&mut T` cannot alias `&mut T` if there is no `﹡mut T` in scope. Of course, if you transmute stuff into `&mut T`, then you'd better make sure that those two `&mut T`s don't overlap. But `﹡mut T` should be fine.