From 78dd5482438b1ba13b4aa2eaa9a7c443a3342ce4 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 20 Nov 2020 18:00:34 +0100 Subject: Upgrade Chalk Also make overflow depth and max type size configurable through env variables. This can be helpful at least for debugging. Fixes #6628. --- crates/hir_ty/src/tests/regression.rs | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'crates/hir_ty/src/tests') diff --git a/crates/hir_ty/src/tests/regression.rs b/crates/hir_ty/src/tests/regression.rs index 94d86b0d1..8cf4e7012 100644 --- a/crates/hir_ty/src/tests/regression.rs +++ b/crates/hir_ty/src/tests/regression.rs @@ -840,3 +840,46 @@ fn issue_4966() { "#]], ); } + +#[test] +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); + } + "#, + 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 + "#]], + ); +} -- cgit v1.2.3