Skip to content

Commit 84fe2ee

Browse files
committedNov 6, 2022
Add more nonsense to weird-exprs.rs.
1 parent 1286ee2 commit 84fe2ee

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎src/test/ui/weird-exprs.rs

+11
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#![allow(unreachable_code)]
99
#![allow(unused_braces, unused_must_use, unused_parens)]
1010
#![allow(uncommon_codepoints, confusable_idents)]
11+
#![allow(unreachable_patterns)]
1112

1213
#![recursion_limit = "256"]
1314

@@ -194,6 +195,15 @@ fn bathroom_stall() {
194195
assert_eq!(i, 13);
195196
}
196197

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+
197207
pub fn main() {
198208
strange();
199209
funny();
@@ -216,4 +226,5 @@ pub fn main() {
216226
𝚌𝚘𝚗𝚝𝚒𝚗𝚞𝚎();
217227
function();
218228
bathroom_stall();
229+
closure_matching();
219230
}

0 commit comments

Comments
 (0)
Please sign in to comment.