aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/tests.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-21 20:47:01 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-21 20:47:01 +0000
commit0d2cb60f93c5e73c0171e83fef36b696cc5dd4ff (patch)
treee786aad9c46072c992c634466e834feb64c856fb /crates/ra_hir/src/ty/tests.rs
parente0d8c86563b72e5414cf10fe16da5e88201447e2 (diff)
parente45f476d5691a6a0d994eb6f777bbf291348f93e (diff)
Merge #586
586: Fix panic trying to get substs on unknown type r=matklad a=flodiebold Fixes #585. Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r--crates/ra_hir/src/ty/tests.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs
index 5aa24a29b..dc9b626dc 100644
--- a/crates/ra_hir/src/ty/tests.rs
+++ b/crates/ra_hir/src/ty/tests.rs
@@ -521,6 +521,22 @@ fn test(x: X) {
521 ); 521 );
522} 522}
523 523
524#[test]
525fn bug_585() {
526 check_inference(
527 r#"
528fn test() {
529 X {};
530 match x {
531 A::B {} => (),
532 A::Y() => (),
533 }
534}
535"#,
536 "bug_585.txt",
537 );
538}
539
524fn infer(content: &str) -> String { 540fn infer(content: &str) -> String {
525 let (db, _, file_id) = MockDatabase::with_single_file(content); 541 let (db, _, file_id) = MockDatabase::with_single_file(content);
526 let source_file = db.source_file(file_id); 542 let source_file = db.source_file(file_id);