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:
|
/// To see that this method works, consider:
|
||||||
///
|
///
|
||||||
/// Let `D` be our binding/temporary and `U` be our other HIR node, with
|
/// 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
|
/// `HIR-postorder(U) < HIR-postorder(D)`. Suppose, as in our example,
|
||||||
/// the yield and D would be one of the calls). Let's show that
|
/// U is the yield and D is one of the calls.
|
||||||
/// `D` is storage-dead at `U`.
|
/// Let's show that `D` is storage-dead at `U`.
|
||||||
///
|
///
|
||||||
/// Remember that storage-live/storage-dead refers to the state of
|
/// Remember that storage-live/storage-dead refers to the state of
|
||||||
/// the *storage*, and does not consider moves/drop flags.
|
/// the *storage*, and does not consider moves/drop flags.
|
||||||
///
|
///
|
||||||
/// Then:
|
/// Then:
|
||||||
|
///
|
||||||
/// 1. From the ordering guarantee of HIR visitors (see
|
/// 1. From the ordering guarantee of HIR visitors (see
|
||||||
/// `rustc_hir::intravisit`), `D` does not dominate `U`.
|
/// `rustc_hir::intravisit`), `D` does not dominate `U`.
|
||||||
|
///
|
||||||
/// 2. Therefore, `D` is *potentially* storage-dead at `U` (because
|
/// 2. Therefore, `D` is *potentially* storage-dead at `U` (because
|
||||||
/// we might visit `U` without ever getting to `D`).
|
/// we might visit `U` without ever getting to `D`).
|
||||||
|
///
|
||||||
/// 3. However, we guarantee that at each HIR point, each
|
/// 3. However, we guarantee that at each HIR point, each
|
||||||
/// binding/temporary is always either always storage-live
|
/// binding/temporary is always either always storage-live
|
||||||
/// or always storage-dead. This is what is being guaranteed
|
/// or always storage-dead. This is what is being guaranteed
|
||||||
/// by `terminating_scopes` including all blocks where the
|
/// by `terminating_scopes` including all blocks where the
|
||||||
/// count of executions is not guaranteed.
|
/// count of executions is not guaranteed.
|
||||||
|
///
|
||||||
/// 4. By `2.` and `3.`, `D` is *statically* storage-dead at `U`,
|
/// 4. By `2.` and `3.`, `D` is *statically* storage-dead at `U`,
|
||||||
/// QED.
|
/// QED.
|
||||||
///
|
///
|
||||||
|
|
|
@ -28,8 +28,9 @@ use std::mem;
|
||||||
impl<'a, 'tcx> Builder<'a, 'tcx> {
|
impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
/// Simplify a candidate so that all match pairs require a test.
|
/// Simplify a candidate so that all match pairs require a test.
|
||||||
///
|
///
|
||||||
/// This method will also split a candidate where the only match-pair is an
|
/// This method will also split a candidate, in which the only
|
||||||
/// or-pattern into multiple candidates. This is so that
|
/// match-pair is an or-pattern, into multiple candidates.
|
||||||
|
/// This is so that
|
||||||
///
|
///
|
||||||
/// match x {
|
/// match x {
|
||||||
/// 0 | 1 => { ... },
|
/// 0 | 1 => { ... },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue