]> git.lizzy.rs Git - rust.git/commitdiff
Use more descriptive name to get `InitializationData` state
authorDylan MacKenzie <ecstaticmorse@gmail.com>
Fri, 14 Feb 2020 05:30:10 +0000 (21:30 -0800)
committerDylan MacKenzie <ecstaticmorse@gmail.com>
Fri, 14 Feb 2020 05:30:10 +0000 (21:30 -0800)
src/librustc_mir/transform/elaborate_drops.rs

index 306fe14266ff9b603d63eb6bdffbbd23000b4324..a4531e53ce178e582c930ed494d2f05a30d8dda6 100644 (file)
@@ -129,7 +129,7 @@ fn seek_before(&mut self, loc: Location) {
         self.uninits.seek_before(loc);
     }
 
-    fn state(&self, path: MovePathIndex) -> (bool, bool) {
+    fn maybe_live_dead(&self, path: MovePathIndex) -> (bool, bool) {
         (self.inits.contains(path), self.uninits.contains(path))
     }
 }
@@ -165,13 +165,13 @@ fn param_env(&self) -> ty::ParamEnv<'tcx> {
 
     fn drop_style(&self, path: Self::Path, mode: DropFlagMode) -> DropStyle {
         let ((maybe_live, maybe_dead), multipart) = match mode {
-            DropFlagMode::Shallow => (self.ctxt.init_data.state(path), false),
+            DropFlagMode::Shallow => (self.ctxt.init_data.maybe_live_dead(path), false),
             DropFlagMode::Deep => {
                 let mut some_live = false;
                 let mut some_dead = false;
                 let mut children_count = 0;
                 on_all_drop_children_bits(self.tcx(), self.body(), self.ctxt.env, path, |child| {
-                    let (live, dead) = self.ctxt.init_data.state(child);
+                    let (live, dead) = self.ctxt.init_data.maybe_live_dead(child);
                     debug!("elaborate_drop: state({:?}) = {:?}", child, (live, dead));
                     some_live |= live;
                     some_dead |= dead;
@@ -303,7 +303,7 @@ fn collect_drop_flags(&mut self) {
                 LookupResult::Exact(e) => e,
                 LookupResult::Parent(None) => continue,
                 LookupResult::Parent(Some(parent)) => {
-                    let (_maybe_live, maybe_dead) = self.init_data.state(parent);
+                    let (_maybe_live, maybe_dead) = self.init_data.maybe_live_dead(parent);
                     if maybe_dead {
                         span_bug!(
                             terminator.source_info.span,
@@ -318,7 +318,7 @@ fn collect_drop_flags(&mut self) {
             };
 
             on_all_drop_children_bits(self.tcx, self.body, self.env, path, |child| {
-                let (maybe_live, maybe_dead) = self.init_data.state(child);
+                let (maybe_live, maybe_dead) = self.init_data.maybe_live_dead(child);
                 debug!(
                     "collect_drop_flags: collecting {:?} from {:?}@{:?} - {:?}",
                     child,