diff options
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index fc1e5b09c..a55551cbb 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -362,11 +362,22 @@ fn test(x: &str, y: isize) { | |||
362 | fn infer_pattern() { | 362 | fn infer_pattern() { |
363 | check_inference( | 363 | check_inference( |
364 | r#" | 364 | r#" |
365 | enum E { A { x: usize }, B } | ||
366 | |||
365 | fn test(x: &i32) { | 367 | fn test(x: &i32) { |
366 | let y = x; | 368 | let y = x; |
367 | let &z = x; | 369 | let &z = x; |
368 | let a = z; | 370 | let a = z; |
369 | let (c, d) = (1, "hello"); | 371 | let (c, d) = (1, "hello"); |
372 | |||
373 | let e = E::A { x: 3 }; | ||
374 | if let E::A { x: x } = e { | ||
375 | x | ||
376 | }; | ||
377 | match e { | ||
378 | E::A { x } => x, | ||
379 | E::B => 1, | ||
380 | }; | ||
370 | } | 381 | } |
371 | "#, | 382 | "#, |
372 | "pattern.txt", | 383 | "pattern.txt", |