From 8a4d9bb80a484193dc24c474af30d0d0e091963b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 16 Jun 2021 10:48:07 +0300 Subject: internal: add fn to minicore --- crates/hir_ty/src/tests/regression.rs | 64 ++++++++++++++++------------------- 1 file changed, 30 insertions(+), 34 deletions(-) (limited to 'crates/hir_ty/src/tests/regression.rs') diff --git a/crates/hir_ty/src/tests/regression.rs b/crates/hir_ty/src/tests/regression.rs index abd9c385a..1edec1615 100644 --- a/crates/hir_ty/src/tests/regression.rs +++ b/crates/hir_ty/src/tests/regression.rs @@ -884,41 +884,37 @@ fn issue_4966() { fn issue_6628() { check_infer( r#" - #[lang = "fn_once"] - pub trait FnOnce { - type Output; - } - - struct S(); - impl S { - fn f(&self, _t: T) {} - fn g(&self, _f: F) {} - } - fn main() { - let s = S(); - s.g(|_x| {}); - s.f(10); - } - "#, +//- minicore: fn +struct S(); +impl S { + fn f(&self, _t: T) {} + fn g(&self, _f: F) {} +} +fn main() { + let s = S(); + s.g(|_x| {}); + s.f(10); +} +"#, expect![[r#" - 105..109 'self': &S - 111..113 '_t': T - 118..120 '{}': () - 146..150 'self': &S - 152..154 '_f': F - 159..161 '{}': () - 174..225 '{ ...10); }': () - 184..185 's': S - 188..189 'S': S() -> S - 188..191 'S()': S - 197..198 's': S - 197..209 's.g(|_x| {})': () - 201..208 '|_x| {}': |&i32| -> () - 202..204 '_x': &i32 - 206..208 '{}': () - 215..216 's': S - 215..222 's.f(10)': () - 219..221 '10': i32 + 40..44 'self': &S + 46..48 '_t': T + 53..55 '{}': () + 81..85 'self': &S + 87..89 '_f': F + 94..96 '{}': () + 109..160 '{ ...10); }': () + 119..120 's': S + 123..124 'S': S() -> S + 123..126 'S()': S + 132..133 's': S + 132..144 's.g(|_x| {})': () + 136..143 '|_x| {}': |&i32| -> () + 137..139 '_x': &i32 + 141..143 '{}': () + 150..151 's': S + 150..157 's.f(10)': () + 154..156 '10': i32 "#]], ); } -- cgit v1.2.3