Skip to content

Commit 0414894

Browse files
Revert "Fix non-capturing closure return type coercion"
1 parent 9f85cd6 commit 0414894

File tree

2 files changed

+0
-37
lines changed

2 files changed

+0
-37
lines changed

compiler/rustc_typeck/src/check/coercion.rs

-6
Original file line numberDiff line numberDiff line change
@@ -1003,12 +1003,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10031003
exprs.len()
10041004
);
10051005

1006-
// The following check fixes #88097, where the compiler erroneously
1007-
// attempted to coerce a closure type to itself via a function pointer.
1008-
if prev_ty == new_ty {
1009-
return Ok(prev_ty);
1010-
}
1011-
10121006
// Special-case that coercion alone cannot handle:
10131007
// Function items or non-capturing closures of differing IDs or InternalSubsts.
10141008
let (a_sig, b_sig) = {

src/test/ui/coercion/issue-88097.rs

-31
This file was deleted.

0 commit comments

Comments
 (0)