2019-11-03 18:00:00 -06:00
|
|
|
// check-pass
|
2017-12-15 14:27:06 -06:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2017-12-15 14:27:06 -06: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) => {},
|
2019-04-22 02:40:08 -05:00
|
|
|
&mut Sexpression::Cons(ref mut expr) => {
|
|
|
|
l = &mut **expr;
|
2016-06-07 05:38:32 -05:00
|
|
|
}
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
causes_error_in_ast(&mut Sexpression::Num(()));
|
2016-06-08 07:26:18 -05:00
|
|
|
}
|