mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
21 lines
370 B
Rust
21 lines
370 B
Rust
// 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(()));
|
|
}
|