Why is `std::ptr::null` not usable with unsized types?
问题 As I understand, the standard (only?) way to make a null pointer in Rust is std::ptr::null . However, that function is declared as follows. pub const fn null<T>() -> *const T In this declaration, T is implicitly assumed to have fixed size (otherwise, it would be T: ?Sized ). As a consequence, it is impossible to use this function with *const str or *const [u32] for example. test it in the playground Is there a good reason for excluding unsized types? What's wrong with wanting to create a null