Remove some deprecated HIR visitation functions #31146
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
Visit
trait is the way to do visitations nowadays. MIR is already using it everywhere (except where it has a hand-rolled traversal), but HIR still has a lot of old visitation code. This PR removes some of it.(There is plenty deprecated HIR visitation code left. We could probably easily remove a lot more, I just wanted to wrap this up for today. There is also some HIR visitation code that will be harder to remove, because of having meaningful extra functionality compared to the
Visit
trait, such as keeping track of subquery nesting depth while doing the visitation.)Motivation
Tips for reviewer
A lot of the change is just whitespace, due to having to add
Ok(())
after somematch
clauses, where thematch
used to be the only thing in a closure, but now it has to be surrounded by braces.Individual commits are more digestible, but it might also make sense to just look at the whole PR.
Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.