I have more questions about what is considered UB. The reference lists things that cause UB, but it doesn't contain the following:
-
dereferencing unaligned references
- the reference says dereferencing an unaligned raw pointer is UB. Does this also apply to references? If not, why?
-
reading uninitialized memory
-
the reference says, it is UB producing an integer (
i*/u*), floating point value (f*), or raw pointer obtained from uninitialized memory, or uninitialized memory in astr.However, I doubt that these are the only types that must be initialized? The reference says that the list is not exhaustive. Is this something that should be added to the list? Or is it one of the things we don't know yet?
-
I'm still inexperienced with unsafe Rust, just trying to understand things.