Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- let mut foo = 5u8; unsafe { let ptr = &mut foo as *mut _ as usize; ptr&=0b11<<62; *(ptr as *mut u8) }
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error[E0384]: cannot assign twice to immutable variable `ptr`
- --> src/main.rs:6:76
- |
- 6 | let mut foo = 5u8; unsafe { let ptr = &mut foo as *mut _ as usize; ptr&=0b11<<62; *(ptr as *mut u8) }
- | --- first assignment to `ptr` ^^^^^^^^^^^^^ cannot assign twice to immutable variable
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0384`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment