about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/graph
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-09-07 00:33:47 +0000
committerbors <bors@rust-lang.org>2020-09-07 00:33:47 +0000
commit838325726a05855f10fbb6b3dc7165a7d8dde7b9 (patch)
tree9420a0b381b8351eb92b86cc8fc05fd52566f22b /compiler/rustc_data_structures/src/graph
parentbf4d6cca4905841b788729b7e6a44eefb8725812 (diff)
parent23f8dd19ff45da374323f0132567319b832c044e (diff)
downloadrust-838325726a05855f10fbb6b3dc7165a7d8dde7b9.tar.gz
rust-838325726a05855f10fbb6b3dc7165a7d8dde7b9.zip
Auto merge of #76422 - Dylan-DPC:rollup-0579ucb, r=Dylan-DPC
Rollup of 18 pull requests

Successful merges:

 - #76273 (Move some Vec UI tests into alloc unit tests)
 - #76274 (Allow try blocks as the argument to return expressions)
 - #76287 (Remove an unnecessary allowed lint)
 - #76293 (Implementation of incompatible features error)
 - #76299 (Make `Ipv4Addr` and `Ipv6Addr` const tests unit tests under `library`)
 - #76302 (Address review comments on `Peekable::next_if`)
 - #76303 (Link to `#capacity-and-reallocation` when using with_capacity)
 - #76305 (Move various ui const tests to `library`)
 - #76309 (Indent a note to make folding work nicer)
 - #76312 (time.rs: Make spelling of "Darwin" consistent)
 - #76318 (Use ops::ControlFlow in rustc_data_structures::graph::iterate)
 - #76324 (Move Vec slice UI tests in library)
 - #76338 (add some intra-doc links to `Iterator`)
 - #76340 (Remove unused duplicated `trivial_dropck_outlives`)
 - #76344 (Improve docs for `std::env::args()`)
 - #76346 (Docs: nlink example typo)
 - #76358 (Minor grammar fix in doc comment for soft-deprecated methods)
 - #76364 (Disable atomics on avr target.)

Failed merges:

 - #76304 (Make delegation methods of `std::net::IpAddr` unstably const)

r? @ghost
Diffstat (limited to 'compiler/rustc_data_structures/src/graph')
-rw-r--r--compiler/rustc_data_structures/src/graph/iterate/mod.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/compiler/rustc_data_structures/src/graph/iterate/mod.rs b/compiler/rustc_data_structures/src/graph/iterate/mod.rs
index 64ff6130ddf..bc3d1ce53ba 100644
--- a/compiler/rustc_data_structures/src/graph/iterate/mod.rs
+++ b/compiler/rustc_data_structures/src/graph/iterate/mod.rs
@@ -87,11 +87,8 @@ where
 }
 
 /// Allows searches to terminate early with a value.
-#[derive(Clone, Copy, Debug)]
-pub enum ControlFlow<T> {
-    Break(T),
-    Continue,
-}
+// FIXME (#75744): remove the alias once the generics are in a better order and `C=()`.
+pub type ControlFlow<T> = std::ops::ControlFlow<(), T>;
 
 /// The status of a node in the depth-first search.
 ///
@@ -260,12 +257,12 @@ where
         _node: G::Node,
         _prior_status: Option<NodeStatus>,
     ) -> ControlFlow<Self::BreakVal> {
-        ControlFlow::Continue
+        ControlFlow::CONTINUE
     }
 
     /// Called after all nodes reachable from this one have been examined.
     fn node_settled(&mut self, _node: G::Node) -> ControlFlow<Self::BreakVal> {
-        ControlFlow::Continue
+        ControlFlow::CONTINUE
     }
 
     /// Behave as if no edges exist from `source` to `target`.
@@ -289,8 +286,8 @@ where
         prior_status: Option<NodeStatus>,
     ) -> ControlFlow<Self::BreakVal> {
         match prior_status {
-            Some(NodeStatus::Visited) => ControlFlow::Break(()),
-            _ => ControlFlow::Continue,
+            Some(NodeStatus::Visited) => ControlFlow::BREAK,
+            _ => ControlFlow::CONTINUE,
         }
     }
 }