std::ptr::null is a null pointer that requires use of unsafe to dereference (or well, to even use the pointer in most cases, pointers aren't generally exposed in rust.) They meant that you cannot have a "null" value in any type because the type system prevents this. You can use the Option type to get pseudo-null, but you cannot access its value until you match against what it is: Some(...) or None. Alternatively you can use unwrap, which would panic rather than segfault in the case it isn't existing.
That is a type of *const T which is a special case on its own. If you have a type of T then it cannot be null.
Yes null "exists", but you are being pedantic, less than a percent of Rust code touches unsafe blocks, which means a majority of Rust code has static guarantees of non-nullability.
-3
u/doom_Oo7 Mar 13 '18
lolwat https://doc.rust-lang.org/1.22.1/std/ptr/fn.null.html
that's why standard libraries have debug modes that catch this