Skip to content

Commit f9ccd39

Browse files
documentation fix
1 parent d65c08e commit f9ccd39

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

compiler/rustc_middle/src/middle/region.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,23 +283,27 @@ pub struct ScopeTree {
283283
/// To see that this method works, consider:
284284
///
285285
/// Let `D` be our binding/temporary and `U` be our other HIR node, with
286-
/// `HIR-postorder(U) < HIR-postorder(D)` (in our example, U would be
287-
/// the yield and D would be one of the calls). Let's show that
288-
/// `D` is storage-dead at `U`.
286+
/// `HIR-postorder(U) < HIR-postorder(D)`. Suppose, as in our example,
287+
/// U is the yield and D is one of the calls.
288+
/// Let's show that `D` is storage-dead at `U`.
289289
///
290290
/// Remember that storage-live/storage-dead refers to the state of
291291
/// the *storage*, and does not consider moves/drop flags.
292292
///
293293
/// Then:
294+
///
294295
/// 1. From the ordering guarantee of HIR visitors (see
295296
/// `rustc_hir::intravisit`), `D` does not dominate `U`.
297+
///
296298
/// 2. Therefore, `D` is *potentially* storage-dead at `U` (because
297299
/// we might visit `U` without ever getting to `D`).
300+
///
298301
/// 3. However, we guarantee that at each HIR point, each
299302
/// binding/temporary is always either always storage-live
300303
/// or always storage-dead. This is what is being guaranteed
301304
/// by `terminating_scopes` including all blocks where the
302305
/// count of executions is not guaranteed.
306+
///
303307
/// 4. By `2.` and `3.`, `D` is *statically* storage-dead at `U`,
304308
/// QED.
305309
///

compiler/rustc_mir_build/src/build/matches/simplify.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ use std::mem;
2828
impl<'a, 'tcx> Builder<'a, 'tcx> {
2929
/// Simplify a candidate so that all match pairs require a test.
3030
///
31-
/// This method will also split a candidate where the only match-pair is an
32-
/// or-pattern into multiple candidates. This is so that
31+
/// This method will also split a candidate, in which the only
32+
/// match-pair is an or-pattern, into multiple candidates.
33+
/// This is so that
3334
///
3435
/// match x {
3536
/// 0 | 1 => { ... },

0 commit comments

Comments
 (0)