Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- let n = 0; let ptr = &n as *const usize; let ptr_to_ptr = &ptr as *const *const usize; ptr_to_ptr as usize
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error[E0606]: casting `&i32` as `*const usize` is invalid
- --> src/main.rs:6:30
- |
- 6 | let n = 0; let ptr = &n as *const usize; let ptr_to_ptr = &ptr as *const *const usize; ptr_to_ptr as usize
- | ^^^^^^^^^^^^^^^^^^
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0606`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment