Skip to content

Commit

Permalink
Add a test for rust-lang#10876
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Mar 12, 2019
1 parent 8f4c226 commit 5c563f9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/test/ui/borrowck/issue-10876.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// run-pass

#![feature(nll)]

enum Nat {
S(Box<Nat>),
Z
}
fn test(x: &mut Nat) {
let mut p = &mut *x;
loop {
match p {
&mut Nat::Z => break,
&mut Nat::S(ref mut n) => p = &mut *n
}
}
}

fn main() {}

0 comments on commit 5c563f9

Please sign in to comment.