Created
May 10, 2016 22:35
-
-
Save arielb1/0cfee392fba82cb86ae0c0c821f46b1e 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
struct Foo { | |
a: Box<u32>, | |
b: Box<u32>, | |
c: Box<u32>, | |
d: Box<u32> | |
} | |
fn star() -> u32 { 0 } | |
fn main() { | |
let f = Foo { | |
a: Box::new(0), | |
b: Box::new(0), | |
c: Box::new(0), | |
d: Box::new(0), | |
}; | |
match star() { | |
0 => drop(f), | |
_ => {} | |
}; | |
star(); | |
let mut g = Foo { | |
a: Box::new(0), | |
b: Box::new(0), | |
c: Box::new(0), | |
d: Box::new(0), | |
}; | |
match star() { | |
0 => drop(g), | |
1 => drop(g.b), | |
2 => drop(g.c), | |
_ => {} | |
}; | |
g.b = Box::new(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment