use syntax_pos::{Span, DUMMY_SP};
pub use crate::mir::interpret::AssertMessage;
-// TODO(nashenas88) Cache only exported for use in librustc_mir/transform/check_unsafety.rs
-pub use crate::mir::cache::{BodyCache, Cache, ReadOnlyBodyCache};
+pub use crate::mir::cache::{BodyCache, ReadOnlyBodyCache};
pub use crate::read_only;
pub mod cache;
pub fn is_predecessor_of<'tcx>(
&self,
other: Location,
- body_cache: ReadOnlyBodyCache<'_, 'tcx>
+ body: ReadOnlyBodyCache<'_, 'tcx>
) -> bool {
// If we are in the same block as the other location and are an earlier statement
// then we are a predecessor of `other`.
}
// If we're in another block, then we want to check that block is a predecessor of `other`.
- let mut queue: Vec<BasicBlock> = body_cache.predecessors_for(other.block).to_vec();
+ let mut queue: Vec<BasicBlock> = body.predecessors_for(other.block).to_vec();
let mut visited = FxHashSet::default();
while let Some(block) = queue.pop() {
// If we haven't visited this block before, then make sure we visit it's predecessors.
if visited.insert(block) {
- queue.extend(body_cache.predecessors_for(block).iter().cloned());
+ queue.extend(body.predecessors_for(block).iter().cloned());
} else {
continue;
}