Basically yes. Safe functions have defined behavior for all valid inputs. Mutable references that alias are not valid inputs. In a safe context, the compiler upholds that invariant. In an unsafe context it's up to the user not to break it with unsafe operations.
View all comments
Show parent comment
3
u/TheoreticalDumbass :illuminati: Oct 26 '24
if i pass aliasing references to safe code expecting them to not alias, is the UB at the callsite of safe code?