For visiting, I've identified these two examples:
|
fn visit_ty(&mut self, t: Ty<'tcx>) -> bool { |
|
match t.kind { |
|
ty::Bound(debruijn, bound_ty) if debruijn == self.binder_index => { |
|
self.types.insert( |
|
bound_ty.var.as_u32(), |
|
match bound_ty.kind { |
|
ty::BoundTyKind::Param(name) => name, |
|
ty::BoundTyKind::Anon => { |
|
Symbol::intern(&format!("^{}", bound_ty.var.as_u32())) |
|
} |
|
}, |
|
); |
|
} |
|
|
|
_ => (), |
|
}; |
|
|
|
t.super_visit_with(self) |
|
} |
|
fn visit_ty(&mut self, t: Ty<'tcx>) -> bool { |
|
// if we are only looking for "constrained" region, we have to |
|
// ignore the inputs to a projection, as they may not appear |
|
// in the normalized form |
|
if self.just_constrained { |
|
match t.kind { |
|
ty::Projection(..) | ty::Opaque(..) => { |
|
return false; |
|
} |
|
_ => {} |
|
} |
|
} |
|
|
|
t.super_visit_with(self) |
|
} |
(the latter would need to handle
ty::ConstKind::Unevaluated the same way
ty::Projection is handled, as "unevaluated" consts are effectively projections)
For folding, I've listed one missing fold_const and two which are missing some recursion, in #70125 (comment).
cc @varkor @yodaldevoid
For visiting, I've identified these two examples:
rust/src/librustc/traits/structural_impls.rs
Lines 256 to 274 in 5aa8f19
rust/src/librustc/ty/fold.rs
Lines 976 to 990 in 5aa8f19
(the latter would need to handle
ty::ConstKind::Unevaluatedthe same wayty::Projectionis handled, as "unevaluated" consts are effectively projections)For folding, I've listed one missing
fold_constand two which are missing some recursion, in #70125 (comment).cc @varkor @yodaldevoid