Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions library/core/src/ops/control_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ impl<B, C> ControlFlow<B, C> {
/// ```
#[inline]
#[stable(feature = "control_flow_enum_is", since = "1.59.0")]
pub fn is_break(&self) -> bool {
#[rustc_const_unstable(feature = "const_control_flow", issue = "none")]
pub const fn is_break(&self) -> bool {
matches!(*self, ControlFlow::Break(_))
}

Expand All @@ -166,7 +167,8 @@ impl<B, C> ControlFlow<B, C> {
/// ```
#[inline]
#[stable(feature = "control_flow_enum_is", since = "1.59.0")]
pub fn is_continue(&self) -> bool {
#[rustc_const_unstable(feature = "const_control_flow", issue = "none")]
pub const fn is_continue(&self) -> bool {
matches!(*self, ControlFlow::Continue(_))
}

Expand Down Expand Up @@ -257,7 +259,8 @@ impl<B, C> ControlFlow<B, C> {
/// ```
#[inline]
#[unstable(feature = "control_flow_ok", issue = "140266")]
pub fn break_ok(self) -> Result<B, C> {
#[rustc_const_unstable(feature = "const_control_flow", issue = "none")]
pub const fn break_ok(self) -> Result<B, C> {
match self {
ControlFlow::Continue(c) => Err(c),
ControlFlow::Break(b) => Ok(b),
Expand Down Expand Up @@ -361,7 +364,8 @@ impl<B, C> ControlFlow<B, C> {
/// ```
#[inline]
#[unstable(feature = "control_flow_ok", issue = "140266")]
pub fn continue_ok(self) -> Result<C, B> {
#[rustc_const_unstable(feature = "const_control_flow", issue = "none")]
pub const fn continue_ok(self) -> Result<C, B> {
match self {
ControlFlow::Continue(c) => Ok(c),
ControlFlow::Break(b) => Err(b),
Expand Down
Loading