]> git.lizzy.rs Git - rust.git/commitdiff
Mark an unreachable case as a bug instead of attempting to show an error to the user
authorOliver Schneider <github35764891676564198441@oli-obk.de>
Sun, 22 Jul 2018 10:17:35 +0000 (12:17 +0200)
committerOliver Schneider <github35764891676564198441@oli-obk.de>
Mon, 23 Jul 2018 07:51:30 +0000 (09:51 +0200)
src/librustc_mir/borrow_check/mod.rs

index cd5ed0e70a323bf9297512e93b4f89384ac00a22..89bbc42df04991af5aee380384eef4383d0ef60e 100644 (file)
@@ -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)