diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-8498.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-8498.rs b/src/test/ui/issues/issue-8498.rs new file mode 100644 index 000000000..e6241b761 --- /dev/null +++ b/src/test/ui/issues/issue-8498.rs @@ -0,0 +1,27 @@ +// run-pass + +pub fn main() { + match &[(Box::new(5),Box::new(7))] { + ps => { + let (ref y, _) = ps[0]; + assert_eq!(**y, 5); + } + } + + match Some(&[(Box::new(5),)]) { + Some(ps) => { + let (ref y,) = ps[0]; + assert_eq!(**y, 5); + } + None => () + } + + match Some(&[(Box::new(5),Box::new(7))]) { + Some(ps) => { + let (ref y, ref z) = ps[0]; + assert_eq!(**y, 5); + assert_eq!(**z, 7); + } + None => () + } +} |