diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2016-09-02 11:55:32 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2016-09-06 11:18:10 -0400 |
| commit | 07df8125e6a32796a14ac253aa0df2a0847098b6 (patch) | |
| tree | fd1d78012d5ec15218b4c3e2cfb9a8c855cf3aca | |
| parent | fe6557eb62c1f8856ed95c6998083d09e6ec470b (diff) | |
| download | rust-07df8125e6a32796a14ac253aa0df2a0847098b6.tar.gz rust-07df8125e6a32796a14ac253aa0df2a0847098b6.zip | |
kill the forbidden code
supplanted by RUST_FORBID_DEP_GRAPH_EDGE
| -rw-r--r-- | src/librustc/dep_graph/graph.rs | 16 | ||||
| -rw-r--r-- | src/librustc/dep_graph/raii.rs | 16 |
2 files changed, 0 insertions, 32 deletions
diff --git a/src/librustc/dep_graph/graph.rs b/src/librustc/dep_graph/graph.rs index ca441c4bc3f..c42eeead69e 100644 --- a/src/librustc/dep_graph/graph.rs +++ b/src/librustc/dep_graph/graph.rs @@ -38,10 +38,6 @@ struct DepGraphData { /// Work-products that we generate in this run. work_products: RefCell<FnvHashMap<Arc<WorkProductId>, WorkProduct>>, - - /// Tracks nodes that are forbidden to read/write; see - /// `DepGraph::forbid`. Used for debugging only. - forbidden: RefCell<Vec<DepNode<DefId>>>, } impl DepGraph { @@ -51,7 +47,6 @@ impl DepGraph { thread: DepGraphThreadData::new(enabled), previous_work_products: RefCell::new(FnvHashMap()), work_products: RefCell::new(FnvHashMap()), - forbidden: RefCell::new(Vec::new()), }) } } @@ -75,15 +70,6 @@ impl DepGraph { raii::DepTask::new(&self.data.thread, key) } - /// Debugging aid -- forbid reads/writes to `key` while the return - /// value is in scope. Note that this is only available when debug - /// assertions are enabled -- you should not check in code that - /// invokes this function. - #[cfg(debug_assertions)] - pub fn forbid<'graph>(&'graph self, key: DepNode<DefId>) -> raii::Forbid<'graph> { - raii::Forbid::new(&self.data.forbidden, key) - } - pub fn with_ignore<OP,R>(&self, op: OP) -> R where OP: FnOnce() -> R { @@ -99,12 +85,10 @@ impl DepGraph { } pub fn read(&self, v: DepNode<DefId>) { - debug_assert!(!self.data.forbidden.borrow().contains(&v)); self.data.thread.enqueue(DepMessage::Read(v)); } pub fn write(&self, v: DepNode<DefId>) { - debug_assert!(!self.data.forbidden.borrow().contains(&v)); self.data.thread.enqueue(DepMessage::Write(v)); } diff --git a/src/librustc/dep_graph/raii.rs b/src/librustc/dep_graph/raii.rs index b344eb48624..4445a02785b 100644 --- a/src/librustc/dep_graph/raii.rs +++ b/src/librustc/dep_graph/raii.rs @@ -49,19 +49,3 @@ impl<'graph> Drop for IgnoreTask<'graph> { } } -pub struct Forbid<'graph> { - forbidden: &'graph RefCell<Vec<DepNode<DefId>>> -} - -impl<'graph> Forbid<'graph> { - pub fn new(forbidden: &'graph RefCell<Vec<DepNode<DefId>>>, node: DepNode<DefId>) -> Self { - forbidden.borrow_mut().push(node); - Forbid { forbidden: forbidden } - } -} - -impl<'graph> Drop for Forbid<'graph> { - fn drop(&mut self) { - self.forbidden.borrow_mut().pop(); - } -} |
