diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2022-11-06 01:22:31 +0100 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2022-11-06 01:37:22 +0100 |
| commit | 84fe2ee9d24cd2b8a44e15ae3214c302e4c3117f (patch) | |
| tree | 5bb748872c5ae86d3d5fc684d6490ba4fde86616 /src | |
| parent | 1286ee23e4e2dec8c1696d3d76c6b26d97bbcf82 (diff) | |
| download | rust-84fe2ee9d24cd2b8a44e15ae3214c302e4c3117f.tar.gz rust-84fe2ee9d24cd2b8a44e15ae3214c302e4c3117f.zip | |
Add more nonsense to weird-exprs.rs.
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/weird-exprs.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/weird-exprs.rs b/src/test/ui/weird-exprs.rs index 4066bcf3bad..d65703ef5ca 100644 --- a/src/test/ui/weird-exprs.rs +++ b/src/test/ui/weird-exprs.rs @@ -8,6 +8,7 @@ #![allow(unreachable_code)] #![allow(unused_braces, unused_must_use, unused_parens)] #![allow(uncommon_codepoints, confusable_idents)] +#![allow(unreachable_patterns)] #![recursion_limit = "256"] @@ -194,6 +195,15 @@ fn bathroom_stall() { assert_eq!(i, 13); } +fn closure_matching() { + let x = |_| Some(1); + let (|x| x) = match x(..) { + |_| Some(2) => |_| Some(3), + |_| _ => unreachable!(), + }; + assert!(matches!(x(..), |_| Some(4))); +} + pub fn main() { strange(); funny(); @@ -216,4 +226,5 @@ pub fn main() { 𝚌𝚘𝚗𝚝𝚒𝚗𝚞𝚎(); function(); bathroom_stall(); + closure_matching(); } |
