diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-08-02 01:58:40 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-08-02 02:40:01 +0300 |
| commit | 62ec2cb7acb1b16d0abd8a2cf40da545a13d29f3 (patch) | |
| tree | 7692fc594e177ae978e2b3951600e8a0edc41a65 /src/librustc_data_structures | |
| parent | 3d0d6ee271a34d2329235b9a04cf4a421d9026cd (diff) | |
| download | rust-62ec2cb7acb1b16d0abd8a2cf40da545a13d29f3.tar.gz rust-62ec2cb7acb1b16d0abd8a2cf40da545a13d29f3.zip | |
Remove some more `cfg(test)`s
Diffstat (limited to 'src/librustc_data_structures')
| -rw-r--r-- | src/librustc_data_structures/graph/dominators/mod.rs | 5 | ||||
| -rw-r--r-- | src/librustc_data_structures/graph/dominators/tests.rs | 8 | ||||
| -rw-r--r-- | src/librustc_data_structures/obligation_forest/tests.rs | 4 |
3 files changed, 5 insertions, 12 deletions
diff --git a/src/librustc_data_structures/graph/dominators/mod.rs b/src/librustc_data_structures/graph/dominators/mod.rs index 04ddca7896a..41e6b72953e 100644 --- a/src/librustc_data_structures/graph/dominators/mod.rs +++ b/src/librustc_data_structures/graph/dominators/mod.rs @@ -127,11 +127,6 @@ impl<Node: Idx> Dominators<Node> { // FIXME -- could be optimized by using post-order-rank self.dominators(node).any(|n| n == dom) } - - #[cfg(test)] - fn all_immediate_dominators(&self) -> &IndexVec<Node, Option<Node>> { - &self.immediate_dominators - } } pub struct Iter<'dom, Node: Idx> { diff --git a/src/librustc_data_structures/graph/dominators/tests.rs b/src/librustc_data_structures/graph/dominators/tests.rs index 70408fb6df1..92301ff6526 100644 --- a/src/librustc_data_structures/graph/dominators/tests.rs +++ b/src/librustc_data_structures/graph/dominators/tests.rs @@ -1,13 +1,13 @@ -use super::super::tests::TestGraph; - use super::*; +use super::super::tests::TestGraph; + #[test] fn diamond() { let graph = TestGraph::new(0, &[(0, 1), (0, 2), (1, 3), (2, 3)]); let dominators = dominators(&graph); - let immediate_dominators = dominators.all_immediate_dominators(); + let immediate_dominators = &dominators.immediate_dominators; assert_eq!(immediate_dominators[0], Some(0)); assert_eq!(immediate_dominators[1], Some(0)); assert_eq!(immediate_dominators[2], Some(0)); @@ -22,7 +22,7 @@ fn paper() { (2, 1)]); let dominators = dominators(&graph); - let immediate_dominators = dominators.all_immediate_dominators(); + let immediate_dominators = &dominators.immediate_dominators; assert_eq!(immediate_dominators[0], None); // <-- note that 0 is not in graph assert_eq!(immediate_dominators[1], Some(6)); assert_eq!(immediate_dominators[2], Some(6)); diff --git a/src/librustc_data_structures/obligation_forest/tests.rs b/src/librustc_data_structures/obligation_forest/tests.rs index 27d4bf4959e..e20466572a2 100644 --- a/src/librustc_data_structures/obligation_forest/tests.rs +++ b/src/librustc_data_structures/obligation_forest/tests.rs @@ -1,6 +1,4 @@ -#![cfg(test)] - -use super::{Error, DoCompleted, ObligationForest, ObligationProcessor, Outcome, ProcessResult}; +use super::*; use std::fmt; use std::marker::PhantomData; |
