2019-11-04 00:00:00 +00:00
|
|
|
// check-pass
|
2017-12-15 20:27:06 +00:00
|
|
|
|
2016-06-07 10:38:32 +00:00
|
|
|
enum Sexpression {
|
2016-06-07 11:35:41 +00:00
|
|
|
Num(()),
|
|
|
|
Cons(&'static mut Sexpression)
|
2016-06-07 10:38:32 +00:00
|
|
|
}
|
|
|
|
|
2017-12-15 20:27:06 +00:00
|
|
|
fn causes_error_in_ast(mut l: &mut Sexpression) {
|
2016-06-07 10:38:32 +00:00
|
|
|
loop { match l {
|
2017-11-15 09:30:30 +00:00
|
|
|
&mut Sexpression::Num(ref mut n) => {},
|
2019-04-22 07:40:08 +00:00
|
|
|
&mut Sexpression::Cons(ref mut expr) => {
|
|
|
|
l = &mut **expr;
|
2016-06-07 10:38:32 +00:00
|
|
|
}
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
causes_error_in_ast(&mut Sexpression::Num(()));
|
2016-06-08 12:26:18 +00:00
|
|
|
}
|