pub struct SwitchTree {
pub id: SwitchId,
pub scrutinee: Expr,
pub body: Box<Stmt>,
pub range: SourceRange,
}Expand description
A switch whose body has been left as a statement tree.
The CFG lowering walks the tree and turns every Stmt::Case
it finds into an edge from this statement’s dispatch, wherever in the tree
it sits. That is what makes Duff’s device work, and it is why sema does not
need to flatten the body into groups in that mode.
Fields§
§id: SwitchIdThis switch’s identity, which break and the labels refer to.
scrutinee: ExprThe controlling expression, after the integer promotions.
body: Box<Stmt>The body, with its labels still in place.
range: SourceRangeWhere the statement was written.
Trait Implementations§
Source§impl Clone for SwitchTree
impl Clone for SwitchTree
Auto Trait Implementations§
impl Freeze for SwitchTree
impl RefUnwindSafe for SwitchTree
impl Send for SwitchTree
impl Sync for SwitchTree
impl Unpin for SwitchTree
impl UnsafeUnpin for SwitchTree
impl UnwindSafe for SwitchTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more