Re:Let rand = main as usize
by duped on Thursday June 06, 2024 @04:30PM
(#40602018)
I believe it has more to do with the fact that function pointers are effectively &'static T (static references) and references are forbidden from being null. But it's probably a bit of both.
In other words `0usize as fn ()` is insta-undefined behavior, and you can't have that in safe code.
In other words `0usize as fn ()` is insta-undefined behavior, and you can't have that in safe code.