diff options
| author | bors <bors@rust-lang.org> | 2025-09-07 20:27:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-09-07 20:27:43 +0000 |
| commit | 12eb345e5593a10e61b4aef766076c8bd552fea6 (patch) | |
| tree | 6d0b3872c9b314438868f0ee31bf22b8ff2be7ee /compiler/rustc_mir_dataflow/src/value_analysis.rs | |
| parent | 23718020b12d7e5a54f82a19910e8356ee719667 (diff) | |
| parent | 36557d1046da672559bda949afa8256add67058b (diff) | |
Auto merge of #146304 - matthiaskrgr:rollup-69hs07h, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - rust-lang/rust#146170 (fix: offline rustdoc html missing favicon) - rust-lang/rust#146209 (Misc LTO cleanups) - rust-lang/rust#146269 (feat(std): emulate flock for solaris via fcntl) - rust-lang/rust#146297 (Introduce PlaceContext::may_observe_address.) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_mir_dataflow/src/value_analysis.rs')
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/value_analysis.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/compiler/rustc_mir_dataflow/src/value_analysis.rs b/compiler/rustc_mir_dataflow/src/value_analysis.rs index 005e7973130..9a00831dc01 100644 --- a/compiler/rustc_mir_dataflow/src/value_analysis.rs +++ b/compiler/rustc_mir_dataflow/src/value_analysis.rs @@ -6,7 +6,7 @@ use rustc_data_structures::fx::{FxHashMap, FxIndexSet, StdEntry}; use rustc_data_structures::stack::ensure_sufficient_stack; use rustc_index::IndexVec; use rustc_index::bit_set::DenseBitSet; -use rustc_middle::mir::visit::{MutatingUseContext, PlaceContext, Visitor}; +use rustc_middle::mir::visit::{PlaceContext, Visitor}; use rustc_middle::mir::*; use rustc_middle::ty::{self, Ty, TyCtxt}; use tracing::debug; @@ -917,12 +917,7 @@ pub fn excluded_locals(body: &Body<'_>) -> DenseBitSet<Local> { impl<'tcx> Visitor<'tcx> for Collector { fn visit_place(&mut self, place: &Place<'tcx>, context: PlaceContext, _location: Location) { - if (context.is_borrow() - || context.is_address_of() - || context.is_drop() - || context == PlaceContext::MutatingUse(MutatingUseContext::AsmOutput)) - && !place.is_indirect() - { + if context.may_observe_address() && !place.is_indirect() { // A pointer to a place could be used to access other places with the same local, // hence we have to exclude the local completely. self.result.insert(place.local); |
