Skip to content

Commit

Permalink
Merge pull request rust-lang#70 from wheals/23175
Browse files Browse the repository at this point in the history
23175
  • Loading branch information
steveklabnik committed Oct 26, 2015
2 parents 6fd8f0f + 689af05 commit 498a336
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 498a336

Please sign in to comment.