summaryrefslogtreecommitdiffstats
path: root/library/core/src/ops/control_flow.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:50 +0000
commit2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35 (patch)
treed325add32978dbdc1db975a438b3a77d571b1ab8 /library/core/src/ops/control_flow.rs
parentReleasing progress-linux version 1.68.2+dfsg1-1~progress7.99u1. (diff)
downloadrustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.tar.xz
rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.zip
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/core/src/ops/control_flow.rs')
-rw-r--r--library/core/src/ops/control_flow.rs43
1 files changed, 0 insertions, 43 deletions
diff --git a/library/core/src/ops/control_flow.rs b/library/core/src/ops/control_flow.rs
index cd183540c..117706fb4 100644
--- a/library/core/src/ops/control_flow.rs
+++ b/library/core/src/ops/control_flow.rs
@@ -259,46 +259,3 @@ impl<R: ops::Try> ControlFlow<R, R::Output> {
}
}
}
-
-impl<B> ControlFlow<B, ()> {
- /// It's frequently the case that there's no value needed with `Continue`,
- /// so this provides a way to avoid typing `(())`, if you prefer it.
- ///
- /// # Examples
- ///
- /// ```
- /// #![feature(control_flow_enum)]
- /// use std::ops::ControlFlow;
- ///
- /// let mut partial_sum = 0;
- /// let last_used = (1..10).chain(20..25).try_for_each(|x| {
- /// partial_sum += x;
- /// if partial_sum > 100 { ControlFlow::Break(x) }
- /// else { ControlFlow::CONTINUE }
- /// });
- /// assert_eq!(last_used.break_value(), Some(22));
- /// ```
- #[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
- pub const CONTINUE: Self = ControlFlow::Continue(());
-}
-
-impl<C> ControlFlow<(), C> {
- /// APIs like `try_for_each` don't need values with `Break`,
- /// so this provides a way to avoid typing `(())`, if you prefer it.
- ///
- /// # Examples
- ///
- /// ```
- /// #![feature(control_flow_enum)]
- /// use std::ops::ControlFlow;
- ///
- /// let mut partial_sum = 0;
- /// (1..10).chain(20..25).try_for_each(|x| {
- /// if partial_sum > 100 { ControlFlow::BREAK }
- /// else { partial_sum += x; ControlFlow::CONTINUE }
- /// });
- /// assert_eq!(partial_sum, 108);
- /// ```
- #[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
- pub const BREAK: Self = ControlFlow::Break(());
-}