2 ms·
It does not. I think your parent must have been doing something strange; if you have a *const T, one that's null will still be a Some. It's &T, which cannot be
by steveklabnik 9y ago
It does not.
I think your parent must have been doing something strange; if you have a *const T, one that's null will still be a Some. It's &T, which cannot be null by definition, that uses the null value as None, since it cannot be null.
- zaarn 9y agoI was actually using mut/const and got this bug, I don't think I used &T since I was handling raw memory addresses.
- steveklabnik 9y agoHm, then I don't know what happened, as I just checked and it's definitely not doing the optimization, as it shouldn't! If you can reproduce you should file a bug.
- zaarn 9y agoIt might help to know that I was writing an UEFI application, so basically kernel mode. Otherwise, I've redesigned the affected subsystem so I'm not sure I could reproduce the behaviour