diff options
author | Florian Diebold <[email protected]> | 2019-02-09 20:31:31 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-02-09 20:53:55 +0000 |
commit | a28d4befaf9984d8a13948adb7b92b1638e63739 (patch) | |
tree | 10f85c89063b657098848e0310f2438ac032fd4b /crates/ra_hir/src/ty/tests.rs | |
parent | c0c3b37255423b3547614d74311c4193c0717b56 (diff) |
Fix another crash, and try harder to prevent stack overflows
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 25 |
1 files changed, 25 insertions, 0 deletions
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() { | |||
693 | ); | 693 | ); |
694 | } | 694 | } |
695 | 695 | ||
696 | #[test] | ||
697 | fn infer_std_crash_5() { | ||
698 | // taken from rustc | ||
699 | check_inference( | ||
700 | "infer_std_crash_5", | ||
701 | r#" | ||
702 | fn extra_compiler_flags() { | ||
703 | for content in doesnt_matter { | ||
704 | let name = if doesnt_matter { | ||
705 | first | ||
706 | } else { | ||
707 | &content | ||
708 | }; | ||
709 | |||
710 | let content = if ICE_REPORT_COMPILER_FLAGS_STRIP_VALUE.contains(&name) { | ||
711 | name | ||
712 | } else { | ||
713 | content | ||
714 | }; | ||
715 | } | ||
716 | } | ||
717 | "#, | ||
718 | ); | ||
719 | } | ||
720 | |||
696 | fn infer(content: &str) -> String { | 721 | fn infer(content: &str) -> String { |
697 | let (db, _, file_id) = MockDatabase::with_single_file(content); | 722 | let (db, _, file_id) = MockDatabase::with_single_file(content); |
698 | let source_file = db.parse(file_id); | 723 | let source_file = db.parse(file_id); |