Skip to content

Commit

Permalink
remove the SimplifiedType from the DepNode for now, just to keep
Browse files Browse the repository at this point in the history
size of `DepNode` smaller and because we are not that fine-grained yet
anyhow
  • Loading branch information
nikomatsakis committed Jan 19, 2016
1 parent 84157db commit b5f85cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/librustc/dep_graph/mod.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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)]
Expand Down
12 changes: 2 additions & 10 deletions src/librustc/middle/traits/mod.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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>> {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/traits/select.rs
Expand Up @@ -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);
Expand Down

0 comments on commit b5f85cf

Please sign in to comment.