From bbe3be9bf8d8e8503b8effbe392d0e449224b406 Mon Sep 17 00:00:00 2001 From: Fabian Wolff Date: Tue, 31 Aug 2021 23:44:15 +0200 Subject: [PATCH] Add explanatory comment --- compiler/rustc_typeck/src/check/coercion.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_typeck/src/check/coercion.rs b/compiler/rustc_typeck/src/check/coercion.rs index e3c43aa8b84..e05d14289c3 100644 --- a/compiler/rustc_typeck/src/check/coercion.rs +++ b/compiler/rustc_typeck/src/check/coercion.rs @@ -941,6 +941,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { exprs.len() ); + // The following check fixes #88097, where the compiler erroneously + // attempted to coerce a closure type to itself via a function pointer. if prev_ty == new_ty { return Ok(prev_ty); }