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

struct Builder<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
    hir: Cx<'a, 'gcx, 'tcx>,
    cfg: CFG<'tcx>,
    fn_span: Span,
    arg_count: usize,
    scopes: Vec<Scope<'tcx>>,
    unpushed_unsafe: Safety,
    push_unsafe_count: usize,
    breakable_scopes: Vec<BreakableScope<'tcx>>,
    source_scopes: IndexVec<SourceScope, SourceScopeData>,
    source_scope_local_data: IndexVec<SourceScope, SourceScopeLocalData>,
    source_scope: SourceScope,
    guard_context: Vec<GuardFrame>,
    var_indices: NodeMap<LocalsForNode>,
    local_decls: IndexVec<Local, LocalDecl<'tcx>>,
    upvar_decls: Vec<UpvarDecl>,
    unit_temp: Option<Place<'tcx>>,
    cached_resume_block: Option<BasicBlock>,
    cached_return_block: Option<BasicBlock>,
    cached_unreachable_block: Option<BasicBlock>,
}
🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Fields

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

the current set of scopes, updated as we traverse; see the scope module for more details

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

The current unsafe block in scope, even if it is hidden by a PushUnsafeBlock

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

The number of push_unsafe_block levels in scope

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

the current set of breakables; see the scope module for more details

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

the vector of all scopes that we have created thus far; we track this for debuginfo later

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

the guard-context: each time we build the guard expression for a match arm, we push onto this stack, and then pop when we finish building it.

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Maps node ids of variable bindings to the Locals created for them. (A match binding can have two locals; the 2nd is for the arm's guard.)

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

cached block with the RESUME terminator; this is created when first set of cleanups are built.

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

cached block with the RETURN terminator

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

cached block with the UNREACHABLE terminator

Methods

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

If we are changing the safety mode, create a new source scope

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Compile expr, yielding a place that we can move from etc.

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

See comment on as_local_operand

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Compile expr, yielding an rvalue.

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Compile expr into a value that can be used as an operand. If expr is a place 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.

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Tries to simplify match_pair, returning true if successful. If successful, new match pairs and bindings will have been pushed into the candidate. If no simplification is possible, Err is returned and no changes are made to candidate.

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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 crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Important traits for Vec<u8>

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Generates the code to perform a test.

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Given that we are performing test against test_place, 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.

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

Important traits for Vec<u8>

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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 crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

Important traits for Vec<u8>

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

The main match algorithm. It begins with a set of candidates candidates and has the job of generating code to determine which of these candidates, if any, is the correct one. The candidates are sorted such that the first item in the list has the highest priority. When a candidate is found to match the value, we will generate a branch to the appropriate block found in arm_blocks.

The return value is a list of "otherwise" blocks. These are points in execution where we found that NONE of the candidates apply. In principle, this means that the input list was not exhaustive, though at present we sometimes are not smart enough to recognize all exhaustive inputs.

It might be surprising that the input can be inexhaustive. Indeed, initially, it is not, because all matches are exhaustive in Rust. But during processing we sometimes divide up the list of candidates and recurse with a non-exhaustive list. This is important to keep the size of the generated code under control. See test_candidates for more details.

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

This is the most subtle part of the matching algorithm. At this point, the input candidates have been fully simplified, and so we know that all remaining match-pairs require some sort of test. To decide what test to do, we take the highest priority candidate (last one in the list) and extract the first match-pair from the list. From this we decide what kind of test is needed using test, defined in the test module.

Note: taking the first match pair is somewhat arbitrary, and we might do better here by choosing more carefully what to test.

For example, consider the following possible match-pairs:

  1. x @ Some(P) -- we will do a Switch to decide what variant x has
  2. x @ 22 -- we will do a SwitchInt
  3. x @ 3..5 -- we will do a range test
  4. etc.

Once we know what sort of test we are going to perform, this test may also help us with other candidates. So we walk over the candidates (from high to low priority) and check. This gives us, for each outcome of the test, a transformed list of candidates. For example, if we are testing the current variant of x.0, and we have a candidate {x.0 @ Some(v), x.1 @ 22}, then we would have a resulting candidate of {(x.0 as Some).0 @ v, x.1 @ 22}. Note that the first match-pair is now simpler (and, in fact, irrefutable).

But there may also be candidates that the test just doesn't apply to. The classical example involves wildcards:

match (x, y, z) {
    (true, _, true) => true,    // (0)
    (_, true, _) => true,       // (1)
    (false, false, _) => false, // (2)
    (true, _, false) => false,  // (3)
}

In that case, after we test on x, there are 2 overlapping candidate sets:

  • If the outcome is that x is true, candidates 0, 1, and 3
  • If the outcome is that x is false, candidates 1 and 2

Here, the traditional "decision tree" method would generate 2 separate code-paths for the 2 separate cases.

In some cases, this duplication can create an exponential amount of code. This is most easily seen by noticing that this method terminates with precisely the reachable arms being reachable - but that problem is trivially NP-complete:

    match (var0, var1, var2, var3, ..) {
        (true, _, _, false, true, ...) => false,
        (_, true, true, false, _, ...) => false,
        (false, _, false, false, _, ...) => false,
        ...
        _ => true
    }

Here the last arm is reachable only if there is an assignment to the variables that does not match any of the literals. Therefore, compilation would take an exponential amount of time in some cases.

That kind of exponential worst-case might not occur in practice, but our simplistic treatment of constants and guards would make it occur in very common situations - for example #29740:

match x {
    "foo" if foo_guard => ...,
    "bar" if bar_guard => ...,
    "baz" if baz_guard => ...,
    ...
}

Here we first test the match-pair x @ "foo", which is an Eq test.

It might seem that we would end up with 2 disjoint candidate sets, consisting of the first candidate or the other 3, but our algorithm doesn't reason about "foo" being distinct from the other constants; it considers the latter arms to potentially match after both outcomes, which obviously leads to an exponential amount of tests.

To avoid these kinds of problems, our algorithm tries to ensure the amount of generated tests is linear. When we do a k-way test, we return an additional "unmatched" set alongside the obvious k sets. When we encounter a candidate that would be present in more than one of the sets, we put it and all candidates below it into the "unmatched" set. This ensures these k+1 sets are disjoint.

After we perform our test, we branch into the appropriate candidate set and recurse with match_candidates. These sub-matches are obviously inexhaustive - as we discarded our otherwise set - so we set their continuation to do match_candidates on the "unmatched" set (which is again inexhaustive).

If you apply this to the above test, you basically wind up with an if-else-if chain, testing each candidate in turn, which is precisely what we want.

In addition to avoiding exponential-time blowups, this algorithm also has nice property that each guard and arm is only generated once.

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Initializes each of the bindings from the candidate by moving/copying/ref'ing the source as appropriate. Tests the guard, if any, and then branches to the arm. Returns the block for the case where the guard fails.

Note: we check earlier that if there is a guard, there cannot be move bindings. This isn't really important for the self-consistency of this fn, but the reason for it should be clear: after we've done the assignments, if there were move bindings, further tests would be a use-after-move (which would in turn be detected by the borrowck code that runs on the MIR).

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Each binding (ref mut var/ref var/mut var/var, where the bound var has type T in the arm body) in a pattern maps to 2+N locals. The first local is a binding for occurrences of var in the guard, which will all have type &T. The N locals are bindings for the T that is referenced by the first local; they are not used outside of the guard. The last local is a binding for occurrences of var in the arm body, which will have type T.

The reason we have N locals rather than just 1 is to accommodate rust-lang/rust#51348: If the arm has N candidate patterns, then in general they can correspond to distinct parts of the matched data, and we want them to be distinct temps in order to simplify checks performed by our internal leveraging of two-phase borrows).

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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 crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

Returns the might_break attribute of the BreakableScope used.

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Pops a scope, which should have region scope region_scope, 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)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Branch out of block to target, exiting all scopes up to and including region_scope. 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)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Creates a path that performs all required cleanup for dropping a generator.

This path terminates in GeneratorDrop. Returns the start of the path. None indicates there’s no cleanup to do at this point.

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Returns the region::Scope of the scope which should be exited by a return.

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Returns the scope that we should use as the lifetime of an operand. Basically, an operand must live until it is consumed. This is similar to, but not quite the same as, the temporary scope (which can be larger or smaller).

Consider:

let x = foo(bar(X, Y));

We wish to pop the storage for X and Y after bar() is called, not after the whole let is completed.

As another example, if the second argument diverges:

foo(Box::new(2), panic!())

We would allocate the box but then free it on the unwinding path; we would also emit a free on the 'success' path from panic, but that will turn out to be removed as dead-code.

When building statics/constants, returns None since intermediate values do not have to be dropped in that case.

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Indicates that place should be dropped on exit from region_scope.

When called with DropKind::Storage, place should be a local with an index higher than the current self.arg_count.

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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.

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

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

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Auto Trait Implementations

impl<'a, 'gcx, 'tcx> !Send for Builder<'a, 'gcx, 'tcx>

impl<'a, 'gcx, 'tcx> !Sync for Builder<'a, 'gcx, 'tcx>