From a28d4befaf9984d8a13948adb7b92b1638e63739 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 9 Feb 2019 21:31:31 +0100 Subject: Fix another crash, and try harder to prevent stack overflows --- crates/ra_hir/src/ty/tests.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 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 e088df97c..8cc771084 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs @@ -693,6 +693,31 @@ pub fn primitive_type() { ); } +#[test] +fn infer_std_crash_5() { + // taken from rustc + check_inference( + "infer_std_crash_5", + r#" +fn extra_compiler_flags() { + for content in doesnt_matter { + let name = if doesnt_matter { + first + } else { + &content + }; + + let content = if ICE_REPORT_COMPILER_FLAGS_STRIP_VALUE.contains(&name) { + name + } else { + content + }; + } +} +"#, + ); +} + 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