summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2023-04-28 17:37:56 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2023-04-28 17:37:56 +0000
commit754a62c306f1c758b12e9e337d6b0885fc8da223 (patch)
tree05b4ce5cbbcd904aa18d156bddbc241ef1ce7a2b /compiler
parentb29b56f5205e278b72ecf346137a355a3e22f2f2 (diff)
downloadrust-754a62c306f1c758b12e9e337d6b0885fc8da223.tar.gz
Fix an ICE in conflict errors diagnostics
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
index 5db0f72919d..ac84188a35f 100644
--- a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
+++ b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
@@ -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));