[−][src]Struct rustc_hir::hir::Block

pub struct Block<'hir> {
    pub stmts: &'hir [Stmt<'hir>],
    pub expr: Option<&'hir Expr<'hir>>,
    pub hir_id: HirId,
    pub rules: BlockCheckMode,
    pub span: Span,
    pub targeted_by_break: bool,
}

A block of statements { .. }, which may have a label (in this case the targeted_by_break field will be true) and may be unsafe by means of the rules being anything but DefaultBlock.

Fields

stmts: &'hir [Stmt<'hir>]

Statements in a block.

expr: Option<&'hir Expr<'hir>>

An expression at the end of the block without a semicolon, if any.

hir_id: HirIdrules: BlockCheckMode

Distinguishes between unsafe { ... } and { ... }.

span: Spantargeted_by_break: bool

If true, then there may exist break 'a values that aim to break out of this block early. Used by 'label: {} blocks and by try {} blocks.

Trait Implementations

impl<'hir> Debug for Block<'hir>[src]

impl<'hir, __CTX> HashStable<__CTX> for Block<'hir> where
    __CTX: HashStableContext, 
[src]

Auto Trait Implementations

impl<'hir> !RefUnwindSafe for Block<'hir>

impl<'hir> !Send for Block<'hir>

impl<'hir> !Sync for Block<'hir>

impl<'hir> Unpin for Block<'hir>

impl<'hir> !UnwindSafe for Block<'hir>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.