about summary refs log tree commit diff
path: root/src/test/ui/issues/issue-25579.rs
blob: 32b4b75b0809ceae272952cf49ab826fff0e08a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// build-pass (FIXME(62277): could be 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(()));
}