Add box pattern test
This commit is contained in:
parent
c8623461a5
commit
2de6eb7bc8
1 changed files with 25 additions and 0 deletions
|
@ -654,3 +654,28 @@ fn slice_tail_pattern() {
|
|||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn box_pattern() {
|
||||
check_infer(
|
||||
r#"
|
||||
#[lang = "owned_box"]
|
||||
pub struct Box<T>(T);
|
||||
|
||||
fn foo(params: Box<i32>) {
|
||||
match params {
|
||||
box integer => {}
|
||||
}
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
52..58 'params': Box<i32>
|
||||
70..124 '{ ... } }': ()
|
||||
76..122 'match ... }': ()
|
||||
82..88 'params': Box<i32>
|
||||
99..110 'box integer': Box<i32>
|
||||
103..110 'integer': i32
|
||||
114..116 '{}': ()
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue