From e5f9d54661a46c3e37130716264f8c5ea7540af9 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Mon, 11 Feb 2019 23:01:52 +0100 Subject: Fix another crash --- crates/ra_hir/src/ty/tests.rs | 19 +++++++++++++++++++ 1 file changed, 19 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 e64fd2749..203f1fe4d 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs @@ -719,6 +719,25 @@ fn extra_compiler_flags() { ); } +#[test] +fn infer_nested_generics_crash() { + // another crash found typechecking rustc + check_inference( + "infer_nested_generics_crash", + r#" +struct Canonical { + value: V, +} +struct QueryResponse { + value: V, +} +fn test(query_response: Canonical>) { + &query_response.value; +} +"#, + ); +} + 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