diff options
Diffstat (limited to 'crates/ra_hir_ty/src/tests/patterns.rs')
-rw-r--r-- | crates/ra_hir_ty/src/tests/patterns.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests/patterns.rs b/crates/ra_hir_ty/src/tests/patterns.rs index e5ef241ca..f937426bd 100644 --- a/crates/ra_hir_ty/src/tests/patterns.rs +++ b/crates/ra_hir_ty/src/tests/patterns.rs | |||
@@ -627,3 +627,28 @@ fn test() { | |||
627 | "### | 627 | "### |
628 | ); | 628 | ); |
629 | } | 629 | } |
630 | |||
631 | #[test] | ||
632 | fn slice_tail_pattern() { | ||
633 | assert_snapshot!( | ||
634 | infer(r#" | ||
635 | fn foo(params: &[i32]) { | ||
636 | match params { | ||
637 | [head, tail @ ..] => { | ||
638 | } | ||
639 | } | ||
640 | } | ||
641 | "#), | ||
642 | @r###" | ||
643 | 7..13 'params': &[i32] | ||
644 | 23..92 '{ ... } }': () | ||
645 | 29..90 'match ... }': () | ||
646 | 35..41 'params': &[i32] | ||
647 | 52..69 '[head,... @ ..]': [i32] | ||
648 | 53..57 'head': &i32 | ||
649 | 59..68 'tail @ ..': &[i32] | ||
650 | 66..68 '..': [i32] | ||
651 | 73..84 '{ }': () | ||
652 | "### | ||
653 | ); | ||
654 | } | ||