Skip to content

Commit 8902ce5

Browse files
matthewjasperAaron1011
authored andcommitted
Address review comments
1 parent 1e71862 commit 8902ce5

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

compiler/rustc_mir/src/dataflow/move_paths/builder.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,16 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
362362
fn gather_terminator(&mut self, term: &Terminator<'tcx>) {
363363
match term.kind {
364364
TerminatorKind::Goto { target: _ }
365+
| TerminatorKind::FalseEdges { .. }
366+
| TerminatorKind::FalseUnwind { .. }
367+
// In some sense returning moves the return place into the current
368+
// call's destination, however, since there are no statements after
369+
// this that could possibly access the return place, this doesn't
370+
// need recording.
365371
| TerminatorKind::Return
366372
| TerminatorKind::Resume
367373
| TerminatorKind::Abort
368374
| TerminatorKind::GeneratorDrop
369-
| TerminatorKind::FalseEdge { .. }
370-
| TerminatorKind::FalseUnwind { .. }
371375
| TerminatorKind::Unreachable => {}
372376

373377
TerminatorKind::Assert { ref cond, .. } => {

compiler/rustc_mir_build/src/build/scope.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ scheduled in a [DropTree]. Later, before `in_breakable_scope` exits, the drops
6969
will be added to the CFG.
7070
7171
Panics are handled in a similar fashion, except that the drops are added to the
72-
mir once the rest of the function has finished being lowered. If a terminator
72+
MIR once the rest of the function has finished being lowered. If a terminator
7373
can panic, call `diverge_from(block)` with the block containing the terminator
7474
`block`.
7575
@@ -285,8 +285,8 @@ impl DropTree {
285285
blocks: &mut IndexVec<DropIdx, Option<BasicBlock>>,
286286
) {
287287
// StorageDead statements can share blocks with each other and also with
288-
// a Drop terminator. We iterate through the blocks to find which blocks
289-
// need
288+
// a Drop terminator. We iterate through the drops to find which drops
289+
// need their own block.
290290
#[derive(Clone, Copy)]
291291
enum Block {
292292
// This drop is unreachable
@@ -295,7 +295,7 @@ impl DropTree {
295295
// specified index.
296296
Shares(DropIdx),
297297
// This drop has more than one way of being reached, or it is
298-
// branched to from outside the tree, or it's predecessor is a
298+
// branched to from outside the tree, or its predecessor is a
299299
// `Value` drop.
300300
Own,
301301
}
@@ -308,7 +308,7 @@ impl DropTree {
308308
needs_block[ROOT_NODE] = Block::Own;
309309
}
310310

311-
// Sort so that we only need to check the last
311+
// Sort so that we only need to check the last value.
312312
let entry_points = &mut self.entry_points;
313313
entry_points.sort();
314314

0 commit comments

Comments
 (0)