Skip to content
Permalink
Browse files

Add a test for #10876

  • Loading branch information...
varkor committed Feb 25, 2019
1 parent 8f4c226 commit 5c563f98b89434eb0aada9a65f256df74d63befc
Showing with 19 additions and 0 deletions.
  1. +19 −0 src/test/ui/borrowck/issue-10876.rs
@@ -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.
You can’t perform that action at this time.