Skip to content

Commit 416dc43

Browse files
authored
Rollup merge of rust-lang#99022 - pierwill:always-storage-live-locals, r=pierwill
MIR dataflow: Rename function to `always_storage_live_locals` Related to rust-lang#99021. r? ```@JakobDegen``` (as discussed on Zulip)
2 parents c4693bc + 8a1c1ec commit 416dc43

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

compiler/rustc_const_eval/src/interpret/eval_context.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use rustc_middle::ty::layout::{
1515
use rustc_middle::ty::{
1616
self, query::TyCtxtAt, subst::SubstsRef, ParamEnv, Ty, TyCtxt, TypeFoldable,
1717
};
18-
use rustc_mir_dataflow::storage::always_live_locals;
18+
use rustc_mir_dataflow::storage::always_storage_live_locals;
1919
use rustc_query_system::ich::StableHashingContext;
2020
use rustc_session::Limit;
2121
use rustc_span::{Pos, Span};
@@ -707,7 +707,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
707707
let mut locals = IndexVec::from_elem(dummy, &body.local_decls);
708708

709709
// Now mark those locals as live that have no `Storage*` annotations.
710-
let always_live = always_live_locals(self.body());
710+
let always_live = always_storage_live_locals(self.body());
711711
for local in locals.indices() {
712712
if always_live.contains(local) {
713713
locals[local].value = LocalValue::Live(Operand::Immediate(Immediate::Uninit));

compiler/rustc_const_eval/src/transform/validate.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use rustc_middle::ty::fold::BottomUpFolder;
1515
use rustc_middle::ty::subst::Subst;
1616
use rustc_middle::ty::{self, InstanceDef, ParamEnv, Ty, TyCtxt, TypeFoldable, TypeVisitable};
1717
use rustc_mir_dataflow::impls::MaybeStorageLive;
18-
use rustc_mir_dataflow::storage::always_live_locals;
18+
use rustc_mir_dataflow::storage::always_storage_live_locals;
1919
use rustc_mir_dataflow::{Analysis, ResultsCursor};
2020
use rustc_target::abi::{Size, VariantIdx};
2121

@@ -49,7 +49,7 @@ impl<'tcx> MirPass<'tcx> for Validator {
4949
let param_env = tcx.param_env(def_id);
5050
let mir_phase = self.mir_phase;
5151

52-
let always_live_locals = always_live_locals(body);
52+
let always_live_locals = always_storage_live_locals(body);
5353
let storage_liveness = MaybeStorageLive::new(always_live_locals)
5454
.into_engine(tcx, body)
5555
.iterate_to_fixpoint()

compiler/rustc_mir_dataflow/src/storage.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_middle::mir::{self, Local};
77
//
88
// FIXME: Currently, we need to traverse the entire MIR to compute this. We should instead store it
99
// as a field in the `LocalDecl` for each `Local`.
10-
pub fn always_live_locals(body: &mir::Body<'_>) -> BitSet<Local> {
10+
pub fn always_storage_live_locals(body: &mir::Body<'_>) -> BitSet<Local> {
1111
let mut always_live_locals = BitSet::new_filled(body.local_decls.len());
1212

1313
for block in body.basic_blocks() {

compiler/rustc_mir_transform/src/generator.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ use rustc_middle::ty::{self, AdtDef, Ty, TyCtxt};
6767
use rustc_mir_dataflow::impls::{
6868
MaybeBorrowedLocals, MaybeLiveLocals, MaybeRequiresStorage, MaybeStorageLive,
6969
};
70-
use rustc_mir_dataflow::storage;
70+
use rustc_mir_dataflow::storage::always_storage_live_locals;
7171
use rustc_mir_dataflow::{self, Analysis};
7272
use rustc_target::abi::VariantIdx;
7373
use rustc_target::spec::PanicStrategy;
@@ -1379,7 +1379,7 @@ impl<'tcx> MirPass<'tcx> for StateTransform {
13791379
},
13801380
);
13811381

1382-
let always_live_locals = storage::always_live_locals(&body);
1382+
let always_live_locals = always_storage_live_locals(&body);
13831383

13841384
let liveness_info =
13851385
locals_live_across_suspend_points(tcx, body, &always_live_locals, movable);

0 commit comments

Comments
 (0)