rustc: Remove root_map usage from _match

This commit is contained in:
Flavio Percoco 2014-04-15 22:47:37 +02:00
parent 13c8edfa2e
commit 3c1b1a31b0

View File

@ -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;
@ -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
@ -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);