Skip to content

Commit 626fd4b

Browse files
committed
prefer expect over let else bug!
1 parent 688e531 commit 626fd4b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/rustc_mir_transform/src/coroutine/by_move_body.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,8 @@ impl<'tcx> MirPass<'tcx> for ByMoveBody {
145145
.enumerate()
146146
{
147147
loop {
148-
let Some(&(parent_field_idx, parent_capture)) = parent_captures.peek() else {
149-
bug!("we ran out of parent captures!")
150-
};
148+
let &(parent_field_idx, parent_capture) =
149+
parent_captures.peek().expect("we ran out of parent captures!");
151150
// A parent matches a child they share the same prefix of projections.
152151
// The child may have more, if it is capturing sub-fields out of
153152
// something that is captured by-move in the parent closure.

0 commit comments

Comments
 (0)