fn main() {
println!("{:p}", std::mem::size_of::<*const u32>());
}
当我在操场上尝试这个时它失败了:
error[E0277]: the trait bound `usize: Pointer` is not satisfied
--> src/main.rs:2:22
|
2 | println!("{:p}", std::mem::size_of::<*const u32>());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Pointer` is not implemented for `usize`
|
= note: required by `std::fmt::Pointer::fmt`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
有没有办法打印原始指针的大小*const u32
?