diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-25579.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-25579.rs b/src/test/ui/issues/issue-25579.rs new file mode 100644 index 000000000..5f5a0f4d2 --- /dev/null +++ b/src/test/ui/issues/issue-25579.rs @@ -0,0 +1,20 @@ +// check-pass + +enum Sexpression { + Num(()), + Cons(&'static mut Sexpression) +} + +fn causes_error_in_ast(mut l: &mut Sexpression) { + loop { match l { + &mut Sexpression::Num(ref mut n) => {}, + &mut Sexpression::Cons(ref mut expr) => { + l = &mut **expr; + } + }} +} + + +fn main() { + causes_error_in_ast(&mut Sexpression::Num(())); +} |