pub enum BlockItem {
Decl(Decl),
Stmt(Stmt),
StaticAssert(StaticAssert),
NestedFunction(FunctionDef),
}Expand description
An element of a Block.
Variants§
Decl(Decl)
A declaration.
Stmt(Stmt)
A statement.
StaticAssert(StaticAssert)
_Static_assert(…); — C11.
NestedFunction(FunctionDef)
GNU’s nested function definition, int f(void) { int g(int x) { … } }.
It is a block item rather than a declaration or a statement: it
declares a name in the enclosing block, contributes no statement to it,
and its body is checked in a scope of its own. Semantic analysis lifts
it to a file-scope item with a hidden environment; see
Sema::nested_function_def.
Trait Implementations§
impl StructuralPartialEq for BlockItem
Auto Trait Implementations§
impl Freeze for BlockItem
impl RefUnwindSafe for BlockItem
impl Send for BlockItem
impl Sync for BlockItem
impl Unpin for BlockItem
impl UnsafeUnpin for BlockItem
impl UnwindSafe for BlockItem
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