rust/src/test/ui/issues/issue-25579.rs

21 lines
370 B
Rust
Raw Normal View History

// check-pass
2016-06-07 05:38:32 -05:00
enum Sexpression {
2016-06-07 06:35:41 -05:00
Num(()),
Cons(&'static mut Sexpression)
2016-06-07 05:38:32 -05:00
}
fn causes_error_in_ast(mut l: &mut Sexpression) {
2016-06-07 05:38:32 -05:00
loop { match l {
2017-11-15 03:30:30 -06:00
&mut Sexpression::Num(ref mut n) => {},
&mut Sexpression::Cons(ref mut expr) => {
l = &mut **expr;
2016-06-07 05:38:32 -05:00
}
}}
}
fn main() {
causes_error_in_ast(&mut Sexpression::Num(()));
2016-06-08 07:26:18 -05:00
}