remove the SimplifiedType from the DepNode for now, just to keep

size of `DepNode` smaller and because we are not that fine-grained yet
anyhow
This commit is contained in:
Niko Matsakis 2016-01-19 16:36:13 -05:00
parent 84157dbd4c
commit b5f85cffc8
3 changed files with 4 additions and 13 deletions

View File

@ -11,7 +11,6 @@
use self::thread::{DepGraphThreadData, DepMessage};
use middle::def_id::DefId;
use middle::ty;
use middle::ty::fast_reject::SimplifiedType;
use rustc_front::hir;
use rustc_front::intravisit::Visitor;
use std::rc::Rc;
@ -102,7 +101,7 @@ pub enum DepNode {
// which would yield an overly conservative dep-graph.
TraitItems(DefId),
ReprHints(DefId),
TraitSelect(DefId, Option<SimplifiedType>),
TraitSelect(DefId),
}
#[derive(Clone)]

View File

@ -20,7 +20,6 @@ use middle::def_id::DefId;
use middle::free_region::FreeRegionMap;
use middle::subst;
use middle::ty::{self, Ty, TypeFoldable};
use middle::ty::fast_reject;
use middle::infer::{self, fixup_err_to_string, InferCtxt};
use std::rc::Rc;
@ -618,15 +617,8 @@ impl<'tcx> FulfillmentError<'tcx> {
impl<'tcx> TraitObligation<'tcx> {
/// Creates the dep-node for selecting/evaluating this trait reference.
fn dep_node(&self, tcx: &ty::ctxt<'tcx>) -> DepNode {
let simplified_ty =
fast_reject::simplify_type(tcx,
self.predicate.skip_binder().self_ty(), // (*)
true);
// (*) skip_binder is ok because `simplify_type` doesn't care about regions
DepNode::TraitSelect(self.predicate.def_id(), simplified_ty)
fn dep_node(&self) -> DepNode {
DepNode::TraitSelect(self.predicate.def_id())
}
fn self_ty(&self) -> ty::Binder<Ty<'tcx>> {

View File

@ -307,7 +307,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
debug!("select({:?})", obligation);
assert!(!obligation.predicate.has_escaping_regions());
let dep_node = obligation.dep_node(self.tcx());
let dep_node = obligation.dep_node();
let _task = self.tcx().dep_graph.in_task(dep_node);
let stack = self.push_stack(TraitObligationStackList::empty(), obligation);