Skip to content

Commit 178a267

Browse files
committed
use span_bug instead of todo
1 parent c3b4c9b commit 178a267

File tree

1 file changed

+4
-3
lines changed
  • compiler/rustc_mir_build/src/builder

1 file changed

+4
-3
lines changed

compiler/rustc_mir_build/src/builder/scope.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -862,17 +862,18 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
862862

863863
let scope = &self.scopes.const_continuable_scopes[break_index];
864864

865-
let state_ty = self.local_decls[scope.state_place.as_local().unwrap()].ty;
865+
let state_decl = &self.local_decls[scope.state_place.as_local().unwrap()];
866+
let state_ty = state_decl.ty;
866867
let discriminant_ty = match state_ty {
867868
ty if ty.is_enum() => ty.discriminant_ty(self.tcx),
868869
ty if ty.is_integral() => ty,
869-
_ => todo!(),
870+
_ => span_bug!(state_decl.source_info.span, "unsupported #[loop_match] state"),
870871
};
871872

872873
let rvalue = match state_ty {
873874
ty if ty.is_enum() => Rvalue::Discriminant(scope.state_place),
874875
ty if ty.is_integral() => Rvalue::Use(Operand::Copy(scope.state_place)),
875-
_ => todo!(),
876+
_ => span_bug!(state_decl.source_info.span, "unsupported #[loop_match] state"),
876877
};
877878

878879
// The PatCtxt is normally used in pattern exhaustiveness checking, but reused here

0 commit comments

Comments
 (0)