Skip to content

Commit 2de6eb7

Browse files
Add box pattern test
1 parent c862346 commit 2de6eb7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

crates/hir_ty/src/tests/patterns.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,3 +654,28 @@ fn slice_tail_pattern() {
654654
"#]],
655655
);
656656
}
657+
658+
#[test]
659+
fn box_pattern() {
660+
check_infer(
661+
r#"
662+
#[lang = "owned_box"]
663+
pub struct Box<T>(T);
664+
665+
fn foo(params: Box<i32>) {
666+
match params {
667+
box integer => {}
668+
}
669+
}
670+
"#,
671+
expect![[r#"
672+
52..58 'params': Box<i32>
673+
70..124 '{ ... } }': ()
674+
76..122 'match ... }': ()
675+
82..88 'params': Box<i32>
676+
99..110 'box integer': Box<i32>
677+
103..110 'integer': i32
678+
114..116 '{}': ()
679+
"#]],
680+
);
681+
}

0 commit comments

Comments
 (0)