Skip to content

Instantly share code, notes, and snippets.

@wrightmikea
Created February 28, 2020 15:09
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 wrightmikea/255ba027bac58272934305b82e136cfb to your computer and use it in GitHub Desktop.
Save wrightmikea/255ba027bac58272934305b82e136cfb to your computer and use it in GitHub Desktop.
// https://github.com/rust-lang/rust/issues/49733
// https://doc.rust-lang.org/1.7.0/book/box-syntax-and-patterns.html
#![feature(box_syntax)]
#[derive(Debug)]
struct Bix(u8);
impl Bix {
pub fn new(x: u8) -> Self {
Bix(*box x) // for demo only, box serves no practical purpose here
}
}
fn main() {
println!("Hello, box1!");
let bix = Bix::new(42);
dbg!(&bix);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment