Skip to content

Commit 011c37d

Browse files
committed
borrowck::mir: alpha-renamed DropFlagState variant names.
1 parent 9fcbe2a commit 011c37d

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/librustc_borrowck/borrowck/mir/dataflow/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -827,11 +827,11 @@ impl<'a, 'tcx> MaybeInitializedLvals<'a, 'tcx> {
827827
state: super::DropFlagState)
828828
{
829829
match state {
830-
DropFlagState::Dead => {
830+
DropFlagState::Absent => {
831831
sets.gen_set.clear_bit(path.idx());
832832
sets.kill_set.set_bit(path.idx());
833833
}
834-
DropFlagState::Live => {
834+
DropFlagState::Present => {
835835
sets.gen_set.set_bit(path.idx());
836836
sets.kill_set.clear_bit(path.idx());
837837
}
@@ -844,11 +844,11 @@ impl<'a, 'tcx> MaybeUninitializedLvals<'a, 'tcx> {
844844
state: super::DropFlagState)
845845
{
846846
match state {
847-
DropFlagState::Dead => {
847+
DropFlagState::Absent => {
848848
sets.gen_set.set_bit(path.idx());
849849
sets.kill_set.clear_bit(path.idx());
850850
}
851-
DropFlagState::Live => {
851+
DropFlagState::Present => {
852852
sets.gen_set.clear_bit(path.idx());
853853
sets.kill_set.set_bit(path.idx());
854854
}
@@ -861,11 +861,11 @@ impl<'a, 'tcx> DefinitelyInitializedLvals<'a, 'tcx> {
861861
state: super::DropFlagState)
862862
{
863863
match state {
864-
DropFlagState::Dead => {
864+
DropFlagState::Absent => {
865865
sets.gen_set.clear_bit(path.idx());
866866
sets.kill_set.set_bit(path.idx());
867867
}
868-
DropFlagState::Live => {
868+
DropFlagState::Present => {
869869
sets.gen_set.set_bit(path.idx());
870870
sets.kill_set.clear_bit(path.idx());
871871
}
@@ -889,7 +889,7 @@ impl<'a, 'tcx> BitDenotation for MaybeInitializedLvals<'a, 'tcx> {
889889
super::drop_flag_effects_for_function_entry(
890890
ctxt.0, ctxt.1, &ctxt.2,
891891
|path, s| {
892-
assert!(s == DropFlagState::Live);
892+
assert!(s == DropFlagState::Present);
893893
sets.on_entry.set_bit(path.idx());
894894
});
895895
}
@@ -956,7 +956,7 @@ impl<'a, 'tcx> BitDenotation for MaybeUninitializedLvals<'a, 'tcx> {
956956
super::drop_flag_effects_for_function_entry(
957957
ctxt.0, ctxt.1, &ctxt.2,
958958
|path, s| {
959-
assert!(s == DropFlagState::Live);
959+
assert!(s == DropFlagState::Present);
960960
sets.on_entry.clear_bit(path.idx());
961961
});
962962
}
@@ -1022,7 +1022,7 @@ impl<'a, 'tcx> BitDenotation for DefinitelyInitializedLvals<'a, 'tcx> {
10221022
super::drop_flag_effects_for_function_entry(
10231023
ctxt.0, ctxt.1, &ctxt.2,
10241024
|path, s| {
1025-
assert!(s == DropFlagState::Live);
1025+
assert!(s == DropFlagState::Present);
10261026
sets.on_entry.set_bit(path.idx());
10271027
});
10281028
}

src/librustc_borrowck/borrowck/mir/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ impl<'b, 'a: 'b, 'tcx: 'a> MirBorrowckCtxt<'b, 'a, 'tcx> {
195195

196196
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
197197
enum DropFlagState {
198-
Live,
199-
Dead
198+
Present, // i.e. initialized
199+
Absent, // i.e. deinitialized or "moved"
200200
}
201201

202202
fn on_all_children_bits<'a, 'tcx, F>(
@@ -266,7 +266,7 @@ fn drop_flag_effects_for_function_entry<'a, 'tcx, F>(
266266
let move_path_index = move_data.rev_lookup.find(&lvalue);
267267
on_all_children_bits(tcx, mir, move_data,
268268
move_path_index,
269-
|moi| callback(moi, DropFlagState::Live));
269+
|moi| callback(moi, DropFlagState::Present));
270270
}
271271
}
272272

@@ -296,7 +296,7 @@ fn drop_flag_effects_for_location<'a, 'tcx, F>(
296296

297297
on_all_children_bits(tcx, mir, move_data,
298298
path,
299-
|moi| callback(moi, DropFlagState::Dead))
299+
|moi| callback(moi, DropFlagState::Absent))
300300
}
301301

302302
let bb = mir.basic_block_data(loc.block);
@@ -306,7 +306,7 @@ fn drop_flag_effects_for_location<'a, 'tcx, F>(
306306
debug!("drop_flag_effects: assignment {:?}", stmt);
307307
on_all_children_bits(tcx, mir, move_data,
308308
move_data.rev_lookup.find(lvalue),
309-
|moi| callback(moi, DropFlagState::Live))
309+
|moi| callback(moi, DropFlagState::Present))
310310
}
311311
},
312312
None => {

0 commit comments

Comments
 (0)