Closed
Description
Hello, following code on nightly playground returns zero, indicating extern type behaving like ZST, while in comparison, size_of
fails to compile. According to the RFC, panicking or compilation failure should happen, so this behavior seem incorrect.
#![feature(extern_types)]
extern {
type Foo;
}
pub fn test() -> usize {
let ptr: *mut Foo = std::ptr::null_mut();
unsafe{std::mem::size_of_val::<Foo>(&*ptr)}
}