|
14 | 14 | //! We walk the set of items and, for each member, generate new constraints. |
15 | 15 |
|
16 | 16 | use hir::def_id::DefId; |
17 | | -use rustc::dep_graph::{DepGraphSafe, DepKind, DepNodeColor}; |
18 | | -use rustc::ich::StableHashingContext; |
19 | 17 | use rustc::ty::subst::Substs; |
20 | 18 | use rustc::ty::{self, Ty, TyCtxt}; |
21 | 19 | use syntax::ast; |
22 | 20 | use rustc::hir; |
23 | 21 | use rustc::hir::itemlikevisit::ItemLikeVisitor; |
24 | 22 |
|
25 | | -use rustc_data_structures::stable_hasher::StableHashingContextProvider; |
26 | | - |
27 | 23 | use super::terms::*; |
28 | 24 | use super::terms::VarianceTerm::*; |
29 | 25 |
|
@@ -132,50 +128,11 @@ impl<'a, 'tcx, 'v> ItemLikeVisitor<'v> for ConstraintContext<'a, 'tcx> { |
132 | 128 | } |
133 | 129 | } |
134 | 130 |
|
135 | | -impl<'a, 'tcx> StableHashingContextProvider for ConstraintContext<'a, 'tcx> { |
136 | | - type ContextType = StableHashingContext<'tcx>; |
137 | | - |
138 | | - fn create_stable_hashing_context(&self) -> Self::ContextType { |
139 | | - self.terms_cx.tcx.create_stable_hashing_context() |
140 | | - } |
141 | | -} |
142 | | - |
143 | | -impl<'a, 'tcx> DepGraphSafe for ConstraintContext<'a, 'tcx> {} |
144 | | - |
145 | 131 | impl<'a, 'tcx> ConstraintContext<'a, 'tcx> { |
146 | 132 | fn visit_node_helper(&mut self, id: ast::NodeId) { |
147 | 133 | let tcx = self.terms_cx.tcx; |
148 | 134 | let def_id = tcx.hir.local_def_id(id); |
149 | | - |
150 | | - // Encapsulate constructing the constraints into a task we can |
151 | | - // reference later. This can go away once the red-green |
152 | | - // algorithm is in place. |
153 | | - // |
154 | | - // See README.md for a detailed discussion |
155 | | - // on dep-graph management. |
156 | | - let dep_node = def_id.to_dep_node(tcx, DepKind::ItemVarianceConstraints); |
157 | | - |
158 | | - if let Some(DepNodeColor::Green(_)) = tcx.dep_graph.node_color(&dep_node) { |
159 | | - // If the corresponding node has already been marked as green, the |
160 | | - // appropriate portion of the DepGraph has already been loaded from |
161 | | - // the previous graph, so we don't do any dep-tracking. Since we |
162 | | - // don't cache any values though, we still have to re-run the |
163 | | - // computation. |
164 | | - tcx.dep_graph.with_ignore(|| { |
165 | | - self.build_constraints_for_item(def_id); |
166 | | - }); |
167 | | - } else { |
168 | | - tcx.dep_graph.with_task(dep_node, |
169 | | - self, |
170 | | - def_id, |
171 | | - visit_item_task); |
172 | | - } |
173 | | - |
174 | | - fn visit_item_task<'a, 'tcx>(ccx: &mut ConstraintContext<'a, 'tcx>, |
175 | | - def_id: DefId) |
176 | | - { |
177 | | - ccx.build_constraints_for_item(def_id); |
178 | | - } |
| 135 | + self.build_constraints_for_item(def_id); |
179 | 136 | } |
180 | 137 |
|
181 | 138 | fn tcx(&self) -> TyCtxt<'a, 'tcx, 'tcx> { |
|
0 commit comments