Skip to content

Commit 07df812

Browse files
committed
kill the forbidden code
supplanted by RUST_FORBID_DEP_GRAPH_EDGE
1 parent fe6557e commit 07df812

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed

src/librustc/dep_graph/graph.rs

-16
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ struct DepGraphData {
3838

3939
/// Work-products that we generate in this run.
4040
work_products: RefCell<FnvHashMap<Arc<WorkProductId>, WorkProduct>>,
41-
42-
/// Tracks nodes that are forbidden to read/write; see
43-
/// `DepGraph::forbid`. Used for debugging only.
44-
forbidden: RefCell<Vec<DepNode<DefId>>>,
4541
}
4642

4743
impl DepGraph {
@@ -51,7 +47,6 @@ impl DepGraph {
5147
thread: DepGraphThreadData::new(enabled),
5248
previous_work_products: RefCell::new(FnvHashMap()),
5349
work_products: RefCell::new(FnvHashMap()),
54-
forbidden: RefCell::new(Vec::new()),
5550
})
5651
}
5752
}
@@ -75,15 +70,6 @@ impl DepGraph {
7570
raii::DepTask::new(&self.data.thread, key)
7671
}
7772

78-
/// Debugging aid -- forbid reads/writes to `key` while the return
79-
/// value is in scope. Note that this is only available when debug
80-
/// assertions are enabled -- you should not check in code that
81-
/// invokes this function.
82-
#[cfg(debug_assertions)]
83-
pub fn forbid<'graph>(&'graph self, key: DepNode<DefId>) -> raii::Forbid<'graph> {
84-
raii::Forbid::new(&self.data.forbidden, key)
85-
}
86-
8773
pub fn with_ignore<OP,R>(&self, op: OP) -> R
8874
where OP: FnOnce() -> R
8975
{
@@ -99,12 +85,10 @@ impl DepGraph {
9985
}
10086

10187
pub fn read(&self, v: DepNode<DefId>) {
102-
debug_assert!(!self.data.forbidden.borrow().contains(&v));
10388
self.data.thread.enqueue(DepMessage::Read(v));
10489
}
10590

10691
pub fn write(&self, v: DepNode<DefId>) {
107-
debug_assert!(!self.data.forbidden.borrow().contains(&v));
10892
self.data.thread.enqueue(DepMessage::Write(v));
10993
}
11094

src/librustc/dep_graph/raii.rs

-16
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,3 @@ impl<'graph> Drop for IgnoreTask<'graph> {
4949
}
5050
}
5151

52-
pub struct Forbid<'graph> {
53-
forbidden: &'graph RefCell<Vec<DepNode<DefId>>>
54-
}
55-
56-
impl<'graph> Forbid<'graph> {
57-
pub fn new(forbidden: &'graph RefCell<Vec<DepNode<DefId>>>, node: DepNode<DefId>) -> Self {
58-
forbidden.borrow_mut().push(node);
59-
Forbid { forbidden: forbidden }
60-
}
61-
}
62-
63-
impl<'graph> Drop for Forbid<'graph> {
64-
fn drop(&mut self) {
65-
self.forbidden.borrow_mut().pop();
66-
}
67-
}

0 commit comments

Comments
 (0)