Skip to content

Commit

Permalink
rustc: Remove root_map usage from _match
Browse files Browse the repository at this point in the history
  • Loading branch information
flaper87 committed Apr 23, 2014
1 parent 13c8edf commit 3c1b1a3
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/librustc/middle/trans/_match.rs
Expand Up @@ -198,7 +198,6 @@ use back::abi;
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;
Expand Down Expand Up @@ -1156,14 +1155,6 @@ fn collect_record_or_struct_fields<'a>(
}
}

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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3c1b1a3

Please sign in to comment.