Struct rustc_mir::build::Builder [] [src]

pub struct Builder<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> { /* fields omitted */ }
🔬 This is a nightly-only experimental API. (rustc_private)

Methods

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

Compile expr, yielding a compile-time constant. Assumes that expr is a valid compile-time constant!

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

Compile expr, yielding an lvalue that we can move from etc.

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

See comment on as_local_operand

🔬 This is a nightly-only experimental API. (rustc_private)

Compile expr, yielding an rvalue.

🔬 This is a nightly-only experimental API. (rustc_private)

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

Returns an operand suitable for use until the end of the current scope expression.

The operand returned from this function will not be valid after an ExprKind::Scope is passed, so please do not return it from functions to avoid bad miscompiles.

🔬 This is a nightly-only experimental API. (rustc_private)

Compile expr into a value that can be used as an operand. If expr is an lvalue like x, this will introduce a temporary tmp = x, so that we capture the value of x at this time.

The operand is known to be live until the end of scope.

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

Compile expr into a fresh temporary. This is used when building up rvalues so as to freeze the value that will be consumed.

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

Compile expr, storing the result into destination, which is assumed to be uninitialized.

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

Identifies what test is needed to decide if match_pair is applicable.

It is a bug to call this with a simplifyable pattern.

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

Generates the code to perform a test.

🔬 This is a nightly-only experimental API. (rustc_private)

Given that we are performing test against test_lvalue, this job sorts out what the status of candidate will be after the test. The resulting_candidates vector stores, for each possible outcome of test, a vector of the candidates that will result. This fn should add a (possibly modified) clone of candidate into resulting_candidates wherever appropriate.

So, for example, if this candidate is x @ Some(P0) and the test is a variant test, then we would add (x as Option).0 @ P0 to the resulting_candidates entry corresponding to the variant Some.

However, in some cases, the test may just not be relevant to candidate. For example, suppose we are testing whether foo.x == 22, but in one match arm we have Foo { x: _, ... }... in that case, the test for what value x has has no particular relevance to this candidate. In such cases, this function just returns false without doing anything. This is used by the overall match_candidates algorithm to structure the match as a whole. See match_candidates for more details.

FIXME(#29623). In some cases, we have some tricky choices to make. for example, if we are testing that x == 22, but the candidate is x @ 13..55, what should we do? In the event that the test is true, we know that the candidate applies, but in the event of false, we don't know that it doesn't apply. For now, we return false, indicate that the test does not apply to this candidate, but it might be we can get tighter match code if we do something a bit different.

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

Declares the bindings of the given pattern and returns the visibility scope for the bindings in this patterns, if such a scope had to be created. NOTE: Declaring the bindings should always be done in their drop scope.

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

Add a new temporary value of type ty storing the result of evaluating expr.

NB: No cleanup is scheduled for this temporary. You should call schedule_drop once the temporary is initialized.

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

Start a loop scope, which tracks where continue and break should branch to. See module comment for more details.

Returns the might_break attribute of the LoopScope used.

🔬 This is a nightly-only experimental API. (rustc_private)

Convenience wrapper that pushes a scope and then executes f to build its contents, popping the scope afterwards.

🔬 This is a nightly-only experimental API. (rustc_private)

Push a scope onto the stack. You can then build code in this scope and call pop_scope afterwards. Note that these two calls must be paired; using in_scope as a convenience wrapper maybe preferable.

🔬 This is a nightly-only experimental API. (rustc_private)

Pops a scope, which should have extent extent, adding any drops onto the end of block that are needed. This must match 1-to-1 with push_scope.

🔬 This is a nightly-only experimental API. (rustc_private)

Branch out of block to target, exiting all scopes up to and including extent. This will insert whatever drops are needed, as well as tracking this exit for the SEME region. See module comment for details.

🔬 This is a nightly-only experimental API. (rustc_private)

Creates a new visibility scope, nested in the current one.

🔬 This is a nightly-only experimental API. (rustc_private)

Finds the loop scope for a given label. This is used for resolving break and continue.

🔬 This is a nightly-only experimental API. (rustc_private)

Given a span and the current visibility scope, make a SourceInfo.

🔬 This is a nightly-only experimental API. (rustc_private)

Returns the extent of the scope which should be exited by a return.

🔬 This is a nightly-only experimental API. (rustc_private)

Returns the topmost active scope, which is known to be alive until the next scope expression.

🔬 This is a nightly-only experimental API. (rustc_private)

Indicates that lvalue should be dropped on exit from extent.

🔬 This is a nightly-only experimental API. (rustc_private)

Schedule dropping of a not-yet-fully-initialised box.

This cleanup will only be translated into unwind branch. The extent should be for the EXPR inside box EXPR. There may only be one “free” scheduled in any given scope.

🔬 This is a nightly-only experimental API. (rustc_private)

Creates a path that performs all required cleanup for unwinding.

This path terminates in Resume. Returns the start of the path. See module comment for more details. None indicates there’s no cleanup to do at this point.

🔬 This is a nightly-only experimental API. (rustc_private)

Utility function for non-scope code to build their own drops

🔬 This is a nightly-only experimental API. (rustc_private)

Utility function for non-scope code to build their own drops

🔬 This is a nightly-only experimental API. (rustc_private)

Create an Assert terminator and return the success block. If the boolean condition operand is not the expected value, a runtime panic will be caused with the given message.