aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/tests.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-02-09 19:55:51 +0000
committerFlorian Diebold <[email protected]>2019-02-09 20:37:30 +0000
commitc0c3b37255423b3547614d74311c4193c0717b56 (patch)
tree1727ab1e847dff6142d7b596793a8be4417b5aa0 /crates/ra_hir/src/ty/tests.rs
parentf1afc933530a87bd0cc7b25726c9a7fff3f3e007 (diff)
Fix another crash found when analyzing rustc
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r--crates/ra_hir/src/ty/tests.rs15
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 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);