aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/expr.rs1
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_std_crash_3.snap13
-rw-r--r--crates/ra_hir/src/ty/tests.rs15
3 files changed, 29 insertions, 0 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs
index 4e61d87ff..bf423d3d8 100644
--- a/crates/ra_hir/src/expr.rs
+++ b/crates/ra_hir/src/expr.rs
@@ -850,6 +850,7 @@ impl ExprCollector {
850 } 850 }
851 851
852 // TODO: implement 852 // TODO: implement
853 ast::PatKind::LiteralPat(_) => Pat::Missing,
853 ast::PatKind::SlicePat(_) | ast::PatKind::RangePat(_) => Pat::Missing, 854 ast::PatKind::SlicePat(_) | ast::PatKind::RangePat(_) => Pat::Missing,
854 }; 855 };
855 let syntax_ptr = SyntaxNodePtr::new(pat.syntax()); 856 let syntax_ptr = SyntaxNodePtr::new(pat.syntax());
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_std_crash_3.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_std_crash_3.snap
new file mode 100644
index 000000000..d15b77e17
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_std_crash_3.snap
@@ -0,0 +1,13 @@
1---
2created: "2019-02-09T18:02:37.377591660Z"
3creator: [email protected]
4source: crates/ra_hir/src/ty/tests.rs
5expression: "&result"
6---
7[18; 102) '{ ... } }': ()
8[24; 100) 'match ... }': ()
9[42; 88) 'SizeSk...tail }': [unknown]
10[76; 80) 'true': [unknown]
11[82; 86) 'tail': [unknown]
12[92; 94) '{}': ()
13
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]
667fn infer_std_crash_3() {
668 // taken from rustc
669 check_inference(
670 "infer_std_crash_3",
671 r#"
672pub fn compute() {
673 match _ {
674 SizeSkeleton::Pointer { non_zero: true, tail } => {}
675 }
676}
677"#,
678 );
679}
680
666fn infer(content: &str) -> String { 681fn 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);