Created
August 10, 2021 13:03
-
-
Save nick96/dffaa7565a5aab6e5863b09be7fefc26 to your computer and use it in GitHub Desktop.
The well rounded rustation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::thread; | |
#[derive(Debug)] | |
struct MyBox(*mut u8); | |
unsafe impl Send for MyBox {} | |
fn main() { | |
let mut x = 5; | |
let test = MyBox(&mut x); | |
let handle = thread::spawn(move || { | |
println!("test={:?}", test); | |
}); | |
handle.join().unwrap(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment