Avoid predecessors having Drop impls
This commit is contained in:
parent
467253ff6a
commit
0367e24f94
2 changed files with 5 additions and 5 deletions
|
@ -461,7 +461,7 @@ impl<'tcx> Body<'tcx> {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn predecessors(&self) -> impl std::ops::Deref<Target = Predecessors> + '_ {
|
||||
pub fn predecessors(&self) -> &Predecessors {
|
||||
self.predecessor_cache.compute(&self.basic_blocks)
|
||||
}
|
||||
|
||||
|
@ -2815,13 +2815,13 @@ impl<'a, 'b> graph::GraphSuccessors<'b> for Body<'a> {
|
|||
|
||||
impl graph::GraphPredecessors<'graph> for Body<'tcx> {
|
||||
type Item = BasicBlock;
|
||||
type Iter = smallvec::IntoIter<[BasicBlock; 4]>;
|
||||
type Iter = std::iter::Copied<std::slice::Iter<'graph, BasicBlock>>;
|
||||
}
|
||||
|
||||
impl graph::WithPredecessors for Body<'tcx> {
|
||||
#[inline]
|
||||
fn predecessors(&self, node: Self::Node) -> <Self as graph::GraphPredecessors<'_>>::Iter {
|
||||
self.predecessors()[node].clone().into_iter()
|
||||
self.predecessors()[node].iter().copied()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -269,13 +269,13 @@ impl graph::WithSuccessors for CoverageGraph {
|
|||
|
||||
impl graph::GraphPredecessors<'graph> for CoverageGraph {
|
||||
type Item = BasicCoverageBlock;
|
||||
type Iter = std::vec::IntoIter<BasicCoverageBlock>;
|
||||
type Iter = std::iter::Copied<std::slice::Iter<'graph, BasicCoverageBlock>>;
|
||||
}
|
||||
|
||||
impl graph::WithPredecessors for CoverageGraph {
|
||||
#[inline]
|
||||
fn predecessors(&self, node: Self::Node) -> <Self as graph::GraphPredecessors<'_>>::Iter {
|
||||
self.predecessors[node].clone().into_iter()
|
||||
self.predecessors[node].iter().copied()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue