Skip to content

Commit

Permalink
Fix IgnoreMut regression
Browse files Browse the repository at this point in the history
  • Loading branch information
willcrichton committed May 28, 2022
1 parent 10d9118 commit 611b797
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/flowistry/src/mir/aliases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use rustc_middle::{
use crate::{
block_timer,
cached::{Cache, CopyCache},
extensions::{is_extension_active, PointerMode},
extensions::{is_extension_active, MutabilityMode, PointerMode},
indexed::{
impls::{LocationDomain, LocationIndex, LocationSet, PlaceSet},
IndexMatrix, RefSet,
Expand Down Expand Up @@ -644,9 +644,14 @@ impl<'tcx> TypeVisitor<'tcx> for LoanCollector<'_, 'tcx> {
};
if let Some(loans) = self.aliases.loans.get(&region) {
let under_immut_ref = self.stack.iter().any(|m| *m == Mutability::Not);
let ignore_mut =
is_extension_active(|mode| mode.mutability_mode == MutabilityMode::IgnoreMut);
self
.loans
.extend(loans.iter().filter_map(|(place, mutability)| {
if ignore_mut {
return Some(place);
}
let loan_mutability = if under_immut_ref {
Mutability::Not
} else {
Expand Down

0 comments on commit 611b797

Please sign in to comment.