Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit f8aae50

Browse files
author
oli
committed
Prefer bug! over unwrap()
1 parent aff4d3e commit f8aae50

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_codegen_ssa/src/mir/debuginfo.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ impl<'tcx, S: Copy, L: Copy> DebugScope<S, L> {
6060
span: Span,
6161
) -> S {
6262
// FIXME(eddyb) this should never be `None`.
63-
let dbg_scope = self.dbg_scope.unwrap();
63+
let dbg_scope = self
64+
.dbg_scope
65+
.unwrap_or_else(|| bug!("`dbg_scope` is only `None` during initialization"));
6466

6567
let pos = span.lo();
6668
if pos < self.file_start_pos || pos >= self.file_end_pos {

0 commit comments

Comments
 (0)