Fix non-capturing closure return type coercion

This commit is contained in:
Fabian Wolff
2021-08-19 01:01:49 +02:00
parent 3d0774d0dc
commit 2884a74d08
2 changed files with 35 additions and 0 deletions

View File

@@ -941,6 +941,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
exprs.len()
);
if prev_ty == new_ty {
return Ok(prev_ty);
}
// Special-case that coercion alone cannot handle:
// Function items or non-capturing closures of differing IDs or InternalSubsts.
let (a_sig, b_sig) = {