Skip to content

Commit

Permalink
23175
Browse files Browse the repository at this point in the history
  • Loading branch information
wheals committed Oct 26, 2015
1 parent d9f2f2c commit 689af05
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/23175.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
enum Foo {
NotLast(Box<Foo>),
Last(u32)
}

fn x(tree: &mut Foo) {
let mut current = tree;

loop {
match current {
&mut Foo::NotLast(ref mut inner) => {
current = &mut *inner;
},
&mut Foo::Last(ref mut val) => {
*val = 1;
},
}
}
}

fn main() {}

0 comments on commit 689af05

Please sign in to comment.