From f1afc933530a87bd0cc7b25726c9a7fff3f3e007 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 9 Feb 2019 19:07:35 +0100 Subject: Fix handling of literal patterns Wrap them in a LiteralPat node so they can be distinguished from literal expressions. --- crates/ra_hir/src/ty/tests.rs | 15 +++++++++++++++ 1 file changed, 15 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 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() { ); } +#[test] +fn infer_std_crash_3() { + // taken from rustc + check_inference( + "infer_std_crash_3", + r#" +pub fn compute() { + match _ { + SizeSkeleton::Pointer { non_zero: true, tail } => {} + } +} +"#, + ); +} + fn infer(content: &str) -> String { let (db, _, file_id) = MockDatabase::with_single_file(content); let source_file = db.parse(file_id); -- cgit v1.2.3