documentation fix
This commit is contained in:
parent
d65c08e9cc
commit
f9ccd39ae3
2 changed files with 10 additions and 5 deletions
|
@ -283,23 +283,27 @@ pub struct ScopeTree {
|
|||
/// To see that this method works, consider:
|
||||
///
|
||||
/// Let `D` be our binding/temporary and `U` be our other HIR node, with
|
||||
/// `HIR-postorder(U) < HIR-postorder(D)` (in our example, U would be
|
||||
/// the yield and D would be one of the calls). Let's show that
|
||||
/// `D` is storage-dead at `U`.
|
||||
/// `HIR-postorder(U) < HIR-postorder(D)`. Suppose, as in our example,
|
||||
/// U is the yield and D is one of the calls.
|
||||
/// Let's show that `D` is storage-dead at `U`.
|
||||
///
|
||||
/// Remember that storage-live/storage-dead refers to the state of
|
||||
/// the *storage*, and does not consider moves/drop flags.
|
||||
///
|
||||
/// Then:
|
||||
///
|
||||
/// 1. From the ordering guarantee of HIR visitors (see
|
||||
/// `rustc_hir::intravisit`), `D` does not dominate `U`.
|
||||
///
|
||||
/// 2. Therefore, `D` is *potentially* storage-dead at `U` (because
|
||||
/// we might visit `U` without ever getting to `D`).
|
||||
///
|
||||
/// 3. However, we guarantee that at each HIR point, each
|
||||
/// binding/temporary is always either always storage-live
|
||||
/// or always storage-dead. This is what is being guaranteed
|
||||
/// by `terminating_scopes` including all blocks where the
|
||||
/// count of executions is not guaranteed.
|
||||
///
|
||||
/// 4. By `2.` and `3.`, `D` is *statically* storage-dead at `U`,
|
||||
/// QED.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue