rust/tests/ui/issues/issue-25579.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
370 B
Rust
Raw Normal View History

// check-pass
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
}
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) => {},
&mut Sexpression::Cons(ref mut expr) => {
l = &mut **expr;
2016-06-07 10:38:32 +00:00
}
}}
}
fn main() {
causes_error_in_ast(&mut Sexpression::Num(()));
2016-06-08 12:26:18 +00:00
}