We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 13e62be + 84fe2ee commit 619add3Copy full SHA for 619add3
src/test/ui/weird-exprs.rs
@@ -8,6 +8,7 @@
8
#![allow(unreachable_code)]
9
#![allow(unused_braces, unused_must_use, unused_parens)]
10
#![allow(uncommon_codepoints, confusable_idents)]
11
+#![allow(unreachable_patterns)]
12
13
#![recursion_limit = "256"]
14
@@ -194,6 +195,15 @@ fn bathroom_stall() {
194
195
assert_eq!(i, 13);
196
}
197
198
+fn closure_matching() {
199
+ let x = |_| Some(1);
200
+ let (|x| x) = match x(..) {
201
+ |_| Some(2) => |_| Some(3),
202
+ |_| _ => unreachable!(),
203
+ };
204
+ assert!(matches!(x(..), |_| Some(4)));
205
+}
206
+
207
pub fn main() {
208
strange();
209
funny();
@@ -216,4 +226,5 @@ pub fn main() {
216
226
𝚌𝚘𝚗𝚝𝚒𝚗𝚞𝚎();
217
227
function();
218
228
bathroom_stall();
229
+ closure_matching();
219
230
0 commit comments