From e45f476d5691a6a0d994eb6f777bbf291348f93e Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Mon, 21 Jan 2019 21:42:19 +0100 Subject: Fix panic trying to get substs on unknown type Fixes #585. --- crates/ra_hir/src/ty/tests.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'crates/ra_hir/src/ty/tests.rs') 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) { ); } +#[test] +fn bug_585() { + check_inference( + r#" +fn test() { + X {}; + match x { + A::B {} => (), + A::Y() => (), + } +} +"#, + "bug_585.txt", + ); +} + fn infer(content: &str) -> String { let (db, _, file_id) = MockDatabase::with_single_file(content); let source_file = db.source_file(file_id); -- cgit v1.2.3