]> git.lizzy.rs Git - rust.git/commitdiff
rustc: Remove root_map usage from _match
authorFlavio Percoco <flaper87@gmail.com>
Tue, 15 Apr 2014 20:47:37 +0000 (22:47 +0200)
committerFlavio Percoco <flaper87@gmail.com>
Wed, 23 Apr 2014 16:19:26 +0000 (18:19 +0200)
src/librustc/middle/trans/_match.rs

index 55f8b3d1fd22772a5e1800ca488f4a642147bcbc..ddda95c06cb252db96cea6b019399cfd481f8d33 100644 (file)
 use driver::session::FullDebugInfo;
 use lib::llvm::{llvm, ValueRef, BasicBlockRef};
 use middle::const_eval;
-use middle::borrowck::root_map_key;
 use middle::lang_items::{UniqStrEqFnLangItem, StrEqFnLangItem};
 use middle::pat_util::*;
 use middle::resolve::DefMap;
@@ -1156,14 +1155,6 @@ fn extend(idents: &mut Vec<ast::Ident> , field_pats: &[ast::FieldPat]) {
     }
 }
 
-fn pats_require_rooting(bcx: &Block, m: &[Match], col: uint) -> bool {
-    m.iter().any(|br| {
-        let pat_id = br.pats.get(col).id;
-        let key = root_map_key {id: pat_id, derefs: 0u };
-        bcx.ccx().maps.root_map.contains_key(&key)
-    })
-}
-
 // Macro for deciding whether any of the remaining matches fit a given kind of
 // pattern.  Note that, because the macro is well-typed, either ALL of the
 // matches should fit that sort of pattern or NONE (however, some of the
@@ -1551,10 +1542,6 @@ fn compile_submatch_continue<'a, 'b>(
         }
     }
 
-    // If we are not matching against an `@T`, we should not be
-    // required to root any values.
-    assert!(!pats_require_rooting(bcx, m, col));
-
     match collect_record_or_struct_fields(bcx, m, col) {
         Some(ref rec_fields) => {
             let pat_ty = node_id_type(bcx, pat_id);