Skip to content

Commit

Permalink
Correct comment and assumption.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Sep 7, 2023
1 parent f96c6e0 commit 4ad22b9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions compiler/rustc_mir_dataflow/src/value_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ impl Map {
let old = self.projections.insert((place, TrackElem::Discriminant), discr);
assert!(old.is_none());

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

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

// Recurse with all fields of this place.
Expand Down

0 comments on commit 4ad22b9

Please sign in to comment.