1
Fork 0

Rollup merge of #110957 - WaffleLapkin:reach_generator_conflict_error, r=cjgillot

Fix an ICE in conflict error diagnostics

Fixes  #110929
r? ``@cjgillot``
This commit is contained in:
Matthias Krüger 2023-04-28 22:56:47 +02:00 committed by GitHub
commit 235d088412
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 1 deletions

View file

@ -1359,7 +1359,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
}
// Get closure's arguments
let ty::Closure(_, substs) = typeck_results.expr_ty(closure_expr).kind() else { unreachable!() };
let ty::Closure(_, substs) = typeck_results.expr_ty(closure_expr).kind() else { /* hir::Closure can be a generator too */ return };
let sig = substs.as_closure().sig();
let tupled_params =
tcx.erase_late_bound_regions(sig.inputs().iter().next().unwrap().map_bound(|&b| b));