]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-11552.rs
Rollup merge of #107114 - Erk-:add-absolute-note-to-path-join, r=m-ou-se
[rust.git] / tests / ui / issues / issue-11552.rs
1 // run-pass
2 #![feature(box_patterns)]
3
4 #[derive(Clone)]
5 enum Noun
6 {
7     Atom(isize),
8     Cell(Box<Noun>, Box<Noun>)
9 }
10
11 fn fas(n: &Noun) -> Noun
12 {
13     match n {
14         &Noun::Cell(box Noun::Atom(2), box Noun::Cell(ref a, _)) => (**a).clone(),
15         _ => panic!("Invalid fas pattern")
16     }
17 }
18
19 pub fn main() {
20     fas(
21         &Noun::Cell(Box::new(Noun::Atom(2)),
22         Box::new(Noun::Cell(Box::new(Noun::Atom(2)), Box::new(Noun::Atom(3)))))
23     );
24 }