Created
January 19, 2015 13:03
-
-
Save tioover/57bcad218c4ca094d557 to your computer and use it in GitHub Desktop.
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::boxed::Box; | |
struct X; | |
struct A {x: Option<Box<X>>} | |
fn main() { | |
let mut a = Box::new(A{x: Some(Box::new(X))}); | |
let mut b = &mut a; | |
let mut c = b.x.take(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment