Mark an unreachable case as a bug instead of attempting to show an error to the user

This commit is contained in:
Oliver Schneider 2018-07-22 12:17:35 +02:00
parent 2aab6af0fa
commit 4fba7d33d6

View file

@ -1853,7 +1853,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
}
}
// promoteds may never be mutated
Place::Promoted(_) => Err(place),
Place::Promoted(_) => bug!("encountered mutable promoted"),
Place::Static(ref static_) => {
if self.tcx.is_static(static_.def_id) != Some(hir::Mutability::MutMutable) {
Err(place)