Skip to content

Commit ff1db77

Browse files
committed
use span_bug instead of todo
1 parent 730a946 commit ff1db77

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -860,17 +860,18 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
860860

861861
let scope = &self.scopes.const_continuable_scopes[break_index];
862862

863-
let state_ty = self.local_decls[scope.state_place.as_local().unwrap()].ty;
863+
let state_decl = &self.local_decls[scope.state_place.as_local().unwrap()];
864+
let state_ty = state_decl.ty;
864865
let discriminant_ty = match state_ty {
865866
ty if ty.is_enum() => ty.discriminant_ty(self.tcx),
866867
ty if ty.is_integral() => ty,
867-
_ => todo!(),
868+
_ => span_bug!(state_decl.source_info.span, "unsupported #[loop_match] state"),
868869
};
869870

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

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

0 commit comments

Comments
 (0)