Skip to content

Commit a486b56

Browse files
committed
Fix wording in comments
1 parent 44959c6 commit a486b56

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

compiler/rustc_mir_transform/src/copy_prop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl<'tcx> crate::MirPass<'tcx> for CopyProp {
4242
for (local, &head) in ssa.copy_classes().iter_enumerated() {
4343
if local != head {
4444
// We need to determine if we can keep the head's storage statements (which enables better optimizations).
45-
// For every local's usage location, if the head is in `maybe_storage_dead`, we have to remove the storage statements for it.
45+
// For every local's usage location, if the head is maybe-uninitialized, we'll need to remove it's storage statements.
4646
head_storage_to_check.insert(head);
4747
}
4848
}
@@ -130,7 +130,7 @@ fn fully_moved_locals(ssa: &SsaLocals, body: &Body<'_>) -> DenseBitSet<Local> {
130130
fully_moved
131131
}
132132

133-
// The replacer will remove tautological moves from the head to the local, so we want the `MaybeUninitializedPlaces`
133+
// We don't want to consider tautological moves in `MaybeUninitializedPlaces`, so we remove them before running it.
134134
struct TautologicalMoveAssignmentRemover<'a, 'tcx> {
135135
tcx: TyCtxt<'tcx>,
136136
copy_classes: &'a IndexSlice<Local, Local>,

tests/mir-opt/copy-prop/copy_prop_storage_dead_twice.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
#![feature(custom_mir, core_intrinsics)]
66

7-
// Check that we do not introduce out-of-bounds access.
7+
// Check that we remove the storage statements if the head
8+
// becomes uninitialized before it is used again.
89

910
use std::intrinsics::mir::*;
1011

0 commit comments

Comments
 (0)