What is the real difference between `*const T` and `*mut T` raw pointers?

I agree. *const T and *mut T are equivalent in terms of UB.

However, as @ExpHP wrote

Using *const T could lead to people thinking they can pass in an &T, and that would be UB.

4 Likes