Skip to content

Commit 25bb51d

Browse files
committed
store ecx, not dep-graph
1 parent 85ac63e commit 25bb51d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/librustc_metadata/index_builder.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rustc::ty;
1717
use rustc_data_structures::fnv::FnvHashMap;
1818

1919
pub struct IndexBuilder<'a, 'tcx> {
20-
dep_graph: &'a DepGraph,
20+
ecx: &'a EncodeContext<'a, 'tcx>,
2121
items: IndexData,
2222
xrefs: FnvHashMap<XRef<'tcx>, u32>, // sequentially-assigned
2323
}
@@ -29,12 +29,16 @@ pub enum XRef<'tcx> { Predicate(ty::Predicate<'tcx>) }
2929
impl<'a, 'tcx> IndexBuilder<'a, 'tcx> {
3030
pub fn new(ecx: &EncodeContext<'a, 'tcx>) -> Self {
3131
IndexBuilder {
32-
dep_graph: &ecx.tcx.dep_graph,
32+
ecx: ecx,
3333
items: IndexData::new(ecx.tcx.map.num_local_def_ids()),
3434
xrefs: FnvHashMap()
3535
}
3636
}
3737

38+
pub fn ecx(&self) {
39+
self.ecx
40+
}
41+
3842
/// Records that `id` is being emitted at the current offset.
3943
/// This data is later used to construct the item index in the
4044
/// metadata so we can quickly find the data for a given item.
@@ -44,7 +48,7 @@ impl<'a, 'tcx> IndexBuilder<'a, 'tcx> {
4448
pub fn record(&mut self, id: DefId, rbml_w: &mut Encoder) -> DepTask<'a> {
4549
let position = rbml_w.mark_stable_position();
4650
self.items.record(id, position);
47-
self.dep_graph.in_task(DepNode::MetaData(id))
51+
self.ecx.tcx.dep_graph.in_task(DepNode::MetaData(id))
4852
}
4953

5054
pub fn add_xref(&mut self, xref: XRef<'tcx>) -> u32 {

0 commit comments

Comments
 (0)