diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-11552.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-11552.rs b/src/test/ui/issues/issue-11552.rs new file mode 100644 index 000000000..bae12375d --- /dev/null +++ b/src/test/ui/issues/issue-11552.rs @@ -0,0 +1,22 @@ +// run-pass +#![feature(box_patterns)] +#![feature(box_syntax)] + +#[derive(Clone)] +enum Noun +{ + Atom(isize), + Cell(Box<Noun>, Box<Noun>) +} + +fn fas(n: &Noun) -> Noun +{ + match n { + &Noun::Cell(box Noun::Atom(2), box Noun::Cell(ref a, _)) => (**a).clone(), + _ => panic!("Invalid fas pattern") + } +} + +pub fn main() { + fas(&Noun::Cell(box Noun::Atom(2), box Noun::Cell(box Noun::Atom(2), box Noun::Atom(3)))); +} |