Skip to content

Commit 2aa3935

Browse files
Use more descriptive name to get InitializationData state
1 parent f0260ae commit 2aa3935

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustc_mir/transform/elaborate_drops.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl InitializationData<'_, '_> {
129129
self.uninits.seek_before(loc);
130130
}
131131

132-
fn state(&self, path: MovePathIndex) -> (bool, bool) {
132+
fn maybe_live_dead(&self, path: MovePathIndex) -> (bool, bool) {
133133
(self.inits.contains(path), self.uninits.contains(path))
134134
}
135135
}
@@ -165,13 +165,13 @@ impl<'a, 'b, 'tcx> DropElaborator<'a, 'tcx> for Elaborator<'a, 'b, 'tcx> {
165165

166166
fn drop_style(&self, path: Self::Path, mode: DropFlagMode) -> DropStyle {
167167
let ((maybe_live, maybe_dead), multipart) = match mode {
168-
DropFlagMode::Shallow => (self.ctxt.init_data.state(path), false),
168+
DropFlagMode::Shallow => (self.ctxt.init_data.maybe_live_dead(path), false),
169169
DropFlagMode::Deep => {
170170
let mut some_live = false;
171171
let mut some_dead = false;
172172
let mut children_count = 0;
173173
on_all_drop_children_bits(self.tcx(), self.body(), self.ctxt.env, path, |child| {
174-
let (live, dead) = self.ctxt.init_data.state(child);
174+
let (live, dead) = self.ctxt.init_data.maybe_live_dead(child);
175175
debug!("elaborate_drop: state({:?}) = {:?}", child, (live, dead));
176176
some_live |= live;
177177
some_dead |= dead;
@@ -303,7 +303,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
303303
LookupResult::Exact(e) => e,
304304
LookupResult::Parent(None) => continue,
305305
LookupResult::Parent(Some(parent)) => {
306-
let (_maybe_live, maybe_dead) = self.init_data.state(parent);
306+
let (_maybe_live, maybe_dead) = self.init_data.maybe_live_dead(parent);
307307
if maybe_dead {
308308
span_bug!(
309309
terminator.source_info.span,
@@ -318,7 +318,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
318318
};
319319

320320
on_all_drop_children_bits(self.tcx, self.body, self.env, path, |child| {
321-
let (maybe_live, maybe_dead) = self.init_data.state(child);
321+
let (maybe_live, maybe_dead) = self.init_data.maybe_live_dead(child);
322322
debug!(
323323
"collect_drop_flags: collecting {:?} from {:?}@{:?} - {:?}",
324324
child,

0 commit comments

Comments
 (0)