]> git.lizzy.rs Git - rust.git/commitdiff
Ignore local kind in MIR dataflow
authorJonas Schievink <jonasschievink@gmail.com>
Mon, 26 Sep 2016 22:24:49 +0000 (00:24 +0200)
committerJonas Schievink <jonasschievink@gmail.com>
Mon, 26 Sep 2016 22:32:08 +0000 (00:32 +0200)
src/librustc_borrowck/borrowck/mir/dataflow/sanity_check.rs

index a6d8e1fa3c0488552d4d7c0c8ef5a79d2201730a..5e22d477c518556b65fb6c123fa33231ed76cd9c 100644 (file)
@@ -13,7 +13,7 @@
 use syntax_pos::Span;
 
 use rustc::ty::{self, TyCtxt};
-use rustc::mir::repr::{self, Mir, LocalKind};
+use rustc::mir::repr::{self, Mir};
 use rustc_data_structures::indexed_vec::Idx;
 
 use super::super::gather_moves::{MovePathIndex, LookupResult};
@@ -73,15 +73,8 @@ fn each_block<'a, 'tcx, O>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     };
     assert!(args.len() == 1);
     let peek_arg_lval = match args[0] {
-        repr::Operand::Consume(ref lval) => match *lval {
-             repr::Lvalue::Local(local) if mir.local_kind(local) == LocalKind::Temp => {
-                 Some(lval)
-             }
-             _ => None
-        },
-        repr::Operand::Constant(_) => {
-            None
-        }
+        repr::Operand::Consume(ref lval @ repr::Lvalue::Local(_)) => Some(lval),
+        _ => None,
     };
 
     let peek_arg_lval = match peek_arg_lval {