aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_std_crash_4.snap16
-rw-r--r--crates/ra_hir/src/ty/tests.rs15
2 files changed, 31 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_std_crash_4.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_std_crash_4.snap
new file mode 100644
index 000000000..fb31883ce
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_std_crash_4.snap
@@ -0,0 +1,16 @@
1---
2created: "2019-02-09T19:55:39.712470520Z"
3creator: [email protected]
4source: crates/ra_hir/src/ty/tests.rs
5expression: "&result"
6---
7[25; 110) '{ ... } }': ()
8[31; 108) 'match ... }': ()
9[37; 42) '*self': [unknown]
10[38; 42) 'self': [unknown]
11[53; 95) 'Borrow...), ..}': [unknown]
12[74; 77) 'box': [unknown]
13[78; 87) 'Primitive': [unknown]
14[88; 89) 'p': [unknown]
15[99; 101) '{}': ()
16
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs
index e0b5a6471..e088df97c 100644
--- a/crates/ra_hir/src/ty/tests.rs
+++ b/crates/ra_hir/src/ty/tests.rs
@@ -678,6 +678,21 @@ pub fn compute() {
678 ); 678 );
679} 679}
680 680
681#[test]
682fn infer_std_crash_4() {
683 // taken from rustc
684 check_inference(
685 "infer_std_crash_4",
686 r#"
687pub fn primitive_type() {
688 match *self {
689 BorrowedRef { type_: box Primitive(p), ..} => {},
690 }
691}
692"#,
693 );
694}
695
681fn infer(content: &str) -> String { 696fn infer(content: &str) -> String {
682 let (db, _, file_id) = MockDatabase::with_single_file(content); 697 let (db, _, file_id) = MockDatabase::with_single_file(content);
683 let source_file = db.parse(file_id); 698 let source_file = db.parse(file_id);