rust/compiler/rustc_middle
Nicholas Nethercote 94cc5bb962 Streamline const folding/visiting.
Type folders can only modify a few "types of interest": `Binder`, `Ty`,
`Predicate`, `Clauses`, `Region`, `Const`. Likewise for type visitors,
but they can also visit errors (via `ErrorGuaranteed`).

Currently the impls of `try_super_fold_with`, `super_fold_with`, and
`super_visit_with` do more than they need to -- they fold/visit values
that cannot contain any types of interest.

This commit removes those unnecessary fold/visit operations, which makes
these impls more similar to the impls for `Ty`. It also removes the
now-unnecessary derived impls for the no-longer-visited types.
2025-07-31 19:29:40 +10:00
..
2025-07-31 19:29:40 +10:00

For more information about how rustc works, see the rustc dev guide.