extract_function does not move locals defined outside of loops
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
//! deref_mut: deref
|
||||
//! index: sized
|
||||
//! fn:
|
||||
//! try:
|
||||
//! pin:
|
||||
//! future: pin
|
||||
//! option:
|
||||
@@ -266,6 +267,28 @@ pub mod ops {
|
||||
}
|
||||
pub use self::function::{Fn, FnMut, FnOnce};
|
||||
// endregion:fn
|
||||
// region:try
|
||||
mod try_ {
|
||||
pub enum ControlFlow<B, C = ()> {
|
||||
Continue(C),
|
||||
Break(B),
|
||||
}
|
||||
pub trait FromResidual<R = Self::Residual> {
|
||||
#[lang = "from_residual"]
|
||||
fn from_residual(residual: R) -> Self;
|
||||
}
|
||||
#[lang = "try"]
|
||||
pub trait Try: FromResidual<Self::Residual> {
|
||||
type Output;
|
||||
type Residual;
|
||||
#[lang = "from_output"]
|
||||
fn from_output(output: Self::Output) -> Self;
|
||||
#[lang = "branch"]
|
||||
fn branch(self) -> ControlFlow<Self::Residual, Self::Output>;
|
||||
}
|
||||
}
|
||||
pub use self::try_::{ControlFlow, FromResidual, Try};
|
||||
// endregion:try
|
||||
}
|
||||
|
||||
// region:eq
|
||||
|
||||
Reference in New Issue
Block a user