pub struct BodyBuilder {
pub span: Span,
pub body: ExprBody,
pub current_block: BlockId,
pub unwind_block: Option<BlockId>,
}Expand description
Helper to construct a small ullbc body.
Fields§
§span: SpanThe span to use for everything.
body: ExprBodyBody under construction.
current_block: BlockIdBlock onto which we’re adding statements. Its terminator is always Return.
unwind_block: Option<BlockId>Block to unwind to; created on demand.
Implementations§
Source§impl BodyBuilder
impl BodyBuilder
pub fn new(span: Span, arg_count: usize) -> Self
Sourcepub fn new_var(&mut self, name: Option<String>, ty: Ty) -> Place
pub fn new_var(&mut self, name: Option<String>, ty: Ty) -> Place
Create a new local. Adds a StorageLive statement if the local is not one of the special
ones (return or function argument).
Sourcefn current_block(&mut self) -> &mut BlockData
fn current_block(&mut self) -> &mut BlockData
Helper.
pub fn push_statement(&mut self, kind: StatementKind)
fn unwind_block(&mut self) -> BlockId
pub fn call(&mut self, call: Call)
pub fn insert_drop(&mut self, place: Place, fn_ptr: FnPtr)
Auto Trait Implementations§
impl Freeze for BodyBuilder
impl RefUnwindSafe for BodyBuilder
impl Send for BodyBuilder
impl Sync for BodyBuilder
impl Unpin for BodyBuilder
impl UnsafeUnpin for BodyBuilder
impl UnwindSafe for BodyBuilder
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
§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original
input to the nom parser, extract more the useful context information. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom,
recreate a context in the original string where the error occurred. Read more