diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-04-09 07:48:55 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-04-09 07:48:55 +0000 |
| commit | 626fd4b258f71ba5f044c31e8e4d50d730d14a1f (patch) | |
| tree | 413e02f9b6d55188e8d09723395fd690ec0c1119 | |
| parent | 688e531925577de3d8f57f717976f7d2d69fd45b (diff) | |
| download | rust-626fd4b258f71ba5f044c31e8e4d50d730d14a1f.tar.gz rust-626fd4b258f71ba5f044c31e8e4d50d730d14a1f.zip | |
prefer `expect` over `let else bug!`
| -rw-r--r-- | compiler/rustc_mir_transform/src/coroutine/by_move_body.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs b/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs index d88c7bebc73..f0a00ebb586 100644 --- a/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs +++ b/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs @@ -145,9 +145,8 @@ impl<'tcx> MirPass<'tcx> for ByMoveBody { .enumerate() { loop { - let Some(&(parent_field_idx, parent_capture)) = parent_captures.peek() else { - bug!("we ran out of parent captures!") - }; + let &(parent_field_idx, parent_capture) = + parent_captures.peek().expect("we ran out of parent captures!"); // A parent matches a child they share the same prefix of projections. // The child may have more, if it is capturing sub-fields out of // something that is captured by-move in the parent closure. |
