Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created August 21, 2019 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rust-play/b6c72b1959bf7b96093bf3c8ff641123 to your computer and use it in GitHub Desktop.
Save rust-play/b6c72b1959bf7b96093bf3c8ff641123 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
struct S {
x: Box<[u8]>
}
fn main() {
let x = S {x: Box::new([0u8; 32])};
crossbeam::scope(|s| {
s.spawn(|_| {
println!("{:?}", x.x);
});
println!("{:?}", x.x);
}).unwrap();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment