Skip to content

Commit 4ad22b9

Browse files
committed
Correct comment and assumption.
1 parent f96c6e0 commit 4ad22b9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

compiler/rustc_mir_dataflow/src/value_analysis.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ impl Map {
752752
let old = self.projections.insert((place, TrackElem::Discriminant), discr);
753753
assert!(old.is_none());
754754

755-
// Allocate a value slot if it doesn't have one.
755+
// Allocate a value slot since it doesn't have one.
756756
assert!(self.places[discr].value_index.is_none());
757757
self.places[discr].value_index = Some(self.value_count.into());
758758
self.value_count += 1;
@@ -769,11 +769,10 @@ impl Map {
769769
let old = self.projections.insert((place, TrackElem::DerefLen), len);
770770
assert!(old.is_none());
771771

772-
// Allocate a value slot if it doesn't have one.
773-
if self.places[len].value_index.is_none() {
774-
self.places[len].value_index = Some(self.value_count.into());
775-
self.value_count += 1;
776-
}
772+
// Allocate a value slot since it doesn't have one.
773+
assert!( self.places[len].value_index.is_none() );
774+
self.places[len].value_index = Some(self.value_count.into());
775+
self.value_count += 1;
777776
}
778777

779778
// Recurse with all fields of this place.

0 commit comments

Comments
 (0)