From 4fba7d33d614a78d1d641dc9b65d4a04e0d36e8a Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Sun, 22 Jul 2018 12:17:35 +0200 Subject: [PATCH] Mark an unreachable case as a bug instead of attempting to show an error to the user --- src/librustc_mir/borrow_check/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs index cd5ed0e70a3..89bbc42df04 100644 --- a/src/librustc_mir/borrow_check/mod.rs +++ b/src/librustc_mir/borrow_check/mod.rs @@ -1853,7 +1853,7 @@ fn is_mutable<'d>( } } // 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) -- 2.44.0