Remove unneeded mut keywords.

This commit is contained in:
Dan Gohman
2017-08-31 12:09:42 -07:00
parent 55ae51acfe
commit 99b361567a
2 changed files with 4 additions and 4 deletions

View File

@@ -467,7 +467,7 @@ impl<T: EntityRef> EntityList<T> {
/// Since the memory comes from the pool, this will be either zero entity references or /// Since the memory comes from the pool, this will be either zero entity references or
/// whatever where in a previously deallocated list. /// whatever where in a previously deallocated list.
pub fn grow_at(&mut self, index: usize, count: usize, pool: &mut ListPool<T>) { pub fn grow_at(&mut self, index: usize, count: usize, pool: &mut ListPool<T>) {
let mut data = self.grow(count, pool); let data = self.grow(count, pool);
// Copy elements after `index` up. // Copy elements after `index` up.
for i in (index + count..data.len()).rev() { for i in (index + count..data.len()).rev() {

View File

@@ -328,7 +328,7 @@ impl Liveness {
where where
PP: Into<ProgramPoint>, PP: Into<ProgramPoint>,
{ {
let mut lr = self.ranges.get_mut(value).expect("Value has no live range"); let lr = self.ranges.get_mut(value).expect("Value has no live range");
lr.move_def_locally(def.into()); lr.move_def_locally(def.into());
} }
@@ -345,7 +345,7 @@ impl Liveness {
layout: &Layout, layout: &Layout,
) -> &mut Affinity { ) -> &mut Affinity {
debug_assert_eq!(Some(ebb), layout.inst_ebb(user)); debug_assert_eq!(Some(ebb), layout.inst_ebb(user));
let mut lr = self.ranges.get_mut(value).expect("Value has no live range"); let lr = self.ranges.get_mut(value).expect("Value has no live range");
let livein = lr.extend_in_ebb(ebb, user, layout); let livein = lr.extend_in_ebb(ebb, user, layout);
assert!(!livein, "{} should already be live in {}", value, ebb); assert!(!livein, "{} should already be live in {}", value, ebb);
&mut lr.affinity &mut lr.affinity
@@ -353,7 +353,7 @@ impl Liveness {
/// Change the affinity of `value` to `Stack` and return the previous affinity. /// Change the affinity of `value` to `Stack` and return the previous affinity.
pub fn spill(&mut self, value: Value) -> Affinity { pub fn spill(&mut self, value: Value) -> Affinity {
let mut lr = self.ranges.get_mut(value).expect("Value has no live range"); let lr = self.ranges.get_mut(value).expect("Value has no live range");
mem::replace(&mut lr.affinity, Affinity::Stack) mem::replace(&mut lr.affinity, Affinity::Stack)
} }