Remove walk_shallow
This commit is contained in:
parent
cc6c5de39d
commit
c2a88ea6ca
1 changed files with 0 additions and 17 deletions
|
@ -78,23 +78,6 @@ impl<'tcx> GenericArg<'tcx> {
|
||||||
pub fn walk(self) -> TypeWalker<'tcx> {
|
pub fn walk(self) -> TypeWalker<'tcx> {
|
||||||
TypeWalker::new(self)
|
TypeWalker::new(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Iterator that walks the immediate children of `self`. Hence
|
|
||||||
/// `Foo<Bar<i32>, u32>` yields the sequence `[Bar<i32>, u32]`
|
|
||||||
/// (but not `i32`, like `walk`).
|
|
||||||
///
|
|
||||||
/// Iterator only walks items once.
|
|
||||||
/// It accepts visited set, updates it with all visited types
|
|
||||||
/// and skips any types that are already there.
|
|
||||||
pub fn walk_shallow(
|
|
||||||
self,
|
|
||||||
visited: &mut SsoHashSet<GenericArg<'tcx>>,
|
|
||||||
) -> impl Iterator<Item = GenericArg<'tcx>> {
|
|
||||||
let mut stack = SmallVec::new();
|
|
||||||
push_inner(&mut stack, self);
|
|
||||||
stack.retain(|a| visited.insert(*a));
|
|
||||||
stack.into_iter()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> Ty<'tcx> {
|
impl<'tcx> Ty<'tcx> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue