Skip to content

Instantly share code, notes, and snippets.

@nick96
Created August 10, 2021 13:03
Show Gist options
  • Save nick96/dffaa7565a5aab6e5863b09be7fefc26 to your computer and use it in GitHub Desktop.
Save nick96/dffaa7565a5aab6e5863b09be7fefc26 to your computer and use it in GitHub Desktop.
The well rounded rustation
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