From afa6be243587e523d5a2fc218db78568041ff296 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Thu, 13 May 2021 20:31:06 +0200 Subject: Update tests with expected changes --- crates/hir_ty/src/infer/unify.rs | 3 -- crates/hir_ty/src/tests/regression.rs | 71 +++++++++++++++++------------------ 2 files changed, 34 insertions(+), 40 deletions(-) diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs index 896d084f4..e7718aa22 100644 --- a/crates/hir_ty/src/infer/unify.rs +++ b/crates/hir_ty/src/infer/unify.rs @@ -295,7 +295,6 @@ impl<'a> InferenceTable<'a> { |ty, _| match ty.kind(&Interner) { &TyKind::InferenceVar(tv, kind) => { if tv_stack.contains(&tv) { - cov_mark::hit!(type_var_cycles_resolve_as_possible); // recursive type return self.type_variable_table.fallback_value(tv, kind); } @@ -366,7 +365,6 @@ mod resolve { ) -> Fallible { let var = self.var_unification_table.inference_var_root(var); if self.var_stack.contains(&var) { - cov_mark::hit!(type_var_cycles_resolve_as_possible); // recursive type let default = self.type_variable_table.fallback_value(var, kind).cast(&Interner); return Ok((self.fallback)(var, VariableKind::Ty(kind), default, outer_binder) @@ -403,7 +401,6 @@ mod resolve { .intern(&Interner) .cast(&Interner); if self.var_stack.contains(&var) { - cov_mark::hit!(type_var_cycles_resolve_as_possible); // recursive return Ok((self.fallback)(var, VariableKind::Const(ty), default, outer_binder) .assert_const_ref(&Interner) diff --git a/crates/hir_ty/src/tests/regression.rs b/crates/hir_ty/src/tests/regression.rs index 431861712..59a16f390 100644 --- a/crates/hir_ty/src/tests/regression.rs +++ b/crates/hir_ty/src/tests/regression.rs @@ -86,8 +86,6 @@ fn bug_651() { #[test] fn recursive_vars() { - cov_mark::check!(type_var_cycles_resolve_completely); - cov_mark::check!(type_var_cycles_resolve_as_possible); check_infer( r#" fn test() { @@ -97,12 +95,12 @@ fn recursive_vars() { "#, expect![[r#" 10..47 '{ ...&y]; }': () - 20..21 'y': &{unknown} - 24..31 'unknown': &{unknown} - 37..44 '[y, &y]': [&&{unknown}; 2] - 38..39 'y': &{unknown} - 41..43 '&y': &&{unknown} - 42..43 'y': &{unknown} + 20..21 'y': {unknown} + 24..31 'unknown': {unknown} + 37..44 '[y, &y]': [{unknown}; 2] + 38..39 'y': {unknown} + 41..43 '&y': &{unknown} + 42..43 'y': {unknown} "#]], ); } @@ -119,19 +117,19 @@ fn recursive_vars_2() { "#, expect![[r#" 10..79 '{ ...x)]; }': () - 20..21 'x': &&{unknown} - 24..31 'unknown': &&{unknown} - 41..42 'y': &&{unknown} - 45..52 'unknown': &&{unknown} - 58..76 '[(x, y..., &x)]': [(&&&{unknown}, &&&{unknown}); 2] - 59..65 '(x, y)': (&&&{unknown}, &&&{unknown}) - 60..61 'x': &&{unknown} - 63..64 'y': &&{unknown} - 67..75 '(&y, &x)': (&&&{unknown}, &&&{unknown}) - 68..70 '&y': &&&{unknown} - 69..70 'y': &&{unknown} - 72..74 '&x': &&&{unknown} - 73..74 'x': &&{unknown} + 20..21 'x': {unknown} + 24..31 'unknown': {unknown} + 41..42 'y': {unknown} + 45..52 'unknown': {unknown} + 58..76 '[(x, y..., &x)]': [({unknown}, {unknown}); 2] + 59..65 '(x, y)': ({unknown}, {unknown}) + 60..61 'x': {unknown} + 63..64 'y': {unknown} + 67..75 '(&y, &x)': (&{unknown}, &{unknown}) + 68..70 '&y': &{unknown} + 69..70 'y': {unknown} + 72..74 '&x': &{unknown} + 73..74 'x': {unknown} "#]], ); } @@ -165,7 +163,6 @@ fn infer_std_crash_1() { #[test] fn infer_std_crash_2() { - cov_mark::check!(type_var_resolves_to_int_var); // caused "equating two type variables, ...", taken from std check_infer( r#" @@ -257,27 +254,27 @@ fn infer_std_crash_5() { expect![[r#" 26..322 '{ ... } }': () 32..320 'for co... }': () - 36..43 'content': &{unknown} + 36..43 'content': {unknown} 47..60 'doesnt_matter': {unknown} 61..320 '{ ... }': () - 75..79 'name': &&{unknown} - 82..166 'if doe... }': &&{unknown} + 75..79 'name': &{unknown} + 82..166 'if doe... }': &{unknown} 85..98 'doesnt_matter': bool - 99..128 '{ ... }': &&{unknown} - 113..118 'first': &&{unknown} - 134..166 '{ ... }': &&{unknown} - 148..156 '&content': &&{unknown} - 149..156 'content': &{unknown} + 99..128 '{ ... }': &{unknown} + 113..118 'first': &{unknown} + 134..166 '{ ... }': &{unknown} + 148..156 '&content': &{unknown} + 149..156 'content': {unknown} 181..188 'content': &{unknown} 191..313 'if ICE... }': &{unknown} 194..231 'ICE_RE..._VALUE': {unknown} 194..247 'ICE_RE...&name)': bool - 241..246 '&name': &&&{unknown} - 242..246 'name': &&{unknown} - 248..276 '{ ... }': &&{unknown} - 262..266 'name': &&{unknown} - 282..313 '{ ... }': &{unknown} - 296..303 'content': &{unknown} + 241..246 '&name': &&{unknown} + 242..246 'name': &{unknown} + 248..276 '{ ... }': &{unknown} + 262..266 'name': &{unknown} + 282..313 '{ ... }': {unknown} + 296..303 'content': {unknown} "#]], ); } @@ -761,7 +758,7 @@ fn issue_4885() { "#, expect![[r#" 136..139 'key': &K - 198..214 '{ ...key) }': impl Future>::Bar> + 198..214 '{ ...key) }': {unknown} 204..207 'bar': fn bar(&K) -> impl Future>::Bar> 204..212 'bar(key)': impl Future>::Bar> 208..211 'key': &K -- cgit v1.2.3