diff options
author | Florian Diebold <[email protected]> | 2019-02-09 18:07:35 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-02-09 20:37:30 +0000 |
commit | f1afc933530a87bd0cc7b25726c9a7fff3f3e007 (patch) | |
tree | cfa9a55a6d9df93129502be655d6c26dee1bc5c1 /crates/ra_hir/src/ty/tests.rs | |
parent | 7ebde241c00cd9eb816b1aa7cb212a946afb0d3e (diff) |
Fix handling of literal patterns
Wrap them in a LiteralPat node so they can be distinguished from literal
expressions.
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 3139eba0b..e0b5a6471 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -663,6 +663,21 @@ fn test_line_buffer() { | |||
663 | ); | 663 | ); |
664 | } | 664 | } |
665 | 665 | ||
666 | #[test] | ||
667 | fn infer_std_crash_3() { | ||
668 | // taken from rustc | ||
669 | check_inference( | ||
670 | "infer_std_crash_3", | ||
671 | r#" | ||
672 | pub fn compute() { | ||
673 | match _ { | ||
674 | SizeSkeleton::Pointer { non_zero: true, tail } => {} | ||
675 | } | ||
676 | } | ||
677 | "#, | ||
678 | ); | ||
679 | } | ||
680 | |||
666 | fn infer(content: &str) -> String { | 681 | fn infer(content: &str) -> String { |
667 | let (db, _, file_id) = MockDatabase::with_single_file(content); | 682 | let (db, _, file_id) = MockDatabase::with_single_file(content); |
668 | let source_file = db.parse(file_id); | 683 | let source_file = db.parse(file_id); |