Skip to content

Commit 4fba7d3

Browse files
committed
Mark an unreachable case as a bug instead of attempting to show an error to the user
1 parent 2aab6af commit 4fba7d3

File tree

1 file changed

+1
-1
lines changed
  • src/librustc_mir/borrow_check

1 file changed

+1
-1
lines changed

src/librustc_mir/borrow_check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1853,7 +1853,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
18531853
}
18541854
}
18551855
// promoteds may never be mutated
1856-
Place::Promoted(_) => Err(place),
1856+
Place::Promoted(_) => bug!("encountered mutable promoted"),
18571857
Place::Static(ref static_) => {
18581858
if self.tcx.is_static(static_.def_id) != Some(hir::Mutability::MutMutable) {
18591859
Err(place)

0 commit comments

Comments
 (0)