|
4 | 4 | use rustc::mir::{BasicBlock, Location}; |
5 | 5 | use rustc_index::bit_set::{BitIter, BitSet, HybridBitSet}; |
6 | 6 |
|
7 | | -use crate::dataflow::move_paths::{HasMoveData, MovePathIndex}; |
8 | 7 | use crate::dataflow::{BitDenotation, DataflowResults, GenKillSet}; |
9 | 8 |
|
10 | 9 | use std::borrow::Borrow; |
@@ -168,43 +167,3 @@ where |
168 | 167 | self.stmt_trans.apply(&mut self.curr_state) |
169 | 168 | } |
170 | 169 | } |
171 | | - |
172 | | -impl<'tcx, T, DR> FlowAtLocation<'tcx, T, DR> |
173 | | -where |
174 | | - T: HasMoveData<'tcx> + BitDenotation<'tcx, Idx = MovePathIndex>, |
175 | | - DR: Borrow<DataflowResults<'tcx, T>>, |
176 | | -{ |
177 | | - pub fn has_any_child_of(&self, mpi: T::Idx) -> Option<T::Idx> { |
178 | | - // We process `mpi` before the loop below, for two reasons: |
179 | | - // - it's a little different from the loop case (we don't traverse its |
180 | | - // siblings); |
181 | | - // - ~99% of the time the loop isn't reached, and this code is hot, so |
182 | | - // we don't want to allocate `todo` unnecessarily. |
183 | | - if self.contains(mpi) { |
184 | | - return Some(mpi); |
185 | | - } |
186 | | - let move_data = self.operator().move_data(); |
187 | | - let move_path = &move_data.move_paths[mpi]; |
188 | | - let mut todo = if let Some(child) = move_path.first_child { |
189 | | - vec![child] |
190 | | - } else { |
191 | | - return None; |
192 | | - }; |
193 | | - |
194 | | - while let Some(mpi) = todo.pop() { |
195 | | - if self.contains(mpi) { |
196 | | - return Some(mpi); |
197 | | - } |
198 | | - let move_path = &move_data.move_paths[mpi]; |
199 | | - if let Some(child) = move_path.first_child { |
200 | | - todo.push(child); |
201 | | - } |
202 | | - // After we've processed the original `mpi`, we should always |
203 | | - // traverse the siblings of any of its children. |
204 | | - if let Some(sibling) = move_path.next_sibling { |
205 | | - todo.push(sibling); |
206 | | - } |
207 | | - } |
208 | | - return None; |
209 | | - } |
210 | | -} |
0 commit comments