Make ast `MutVisitor` have the same method name and style as `Visitor` by oli-obk · Pull Request #127524 · rust-lang/rust

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Jul 9, 2024

cjgillot

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jul 13, 2024
Make ast `MutVisitor` have the same method name and style as `Visitor`

It doesn't map 100% because some `MutVisitor` methods can filter or even expand to multiple items, but consistency seems nicer.

The last commit showcases how similar they are by changing ast validation to a `MutVisitor` (without actually doing any mutation yet). My plan is to replace all nodes that support it with error nodes if validation failed on them. This allows ast lowering to just assume things are error or valid, and avoids having to redo some checks, delaying bugs or checking the global error counter.

tracking issue: rust-lang#127615

petrochenkov

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Jul 16, 2024
…ions, r=petrochenkov

Various ast validation simplifications

Changes pulled out of rust-lang#127524

These are needed to make ast validation a mutable visitor, as we can't keep immutable references to the AST around in that case. But I think they are simplifying things in general and can stand on their own

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jul 22, 2024
Make ast `MutVisitor` have the same method name and style as `Visitor`

It doesn't map 100% because some `MutVisitor` methods can filter or even expand to multiple items, but consistency seems nicer.

tracking issue: rust-lang#127615

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Jul 23, 2024

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jul 23, 2024
…nkov

Make ast `MutVisitor` have the same method name and style as `Visitor`

It doesn't map 100% because some `MutVisitor` methods can filter or even expand to multiple items, but consistency seems nicer.

tracking issue: rust-lang#127615

@bors bors added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

and removed S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

labels

Jul 23, 2024

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Jul 23, 2024

@bors bors mentioned this pull request

Jul 24, 2024

flip1995 pushed a commit to flip1995/rust that referenced this pull request

Jul 25, 2024
…nkov

Make ast `MutVisitor` have the same method name and style as `Visitor`

It doesn't map 100% because some `MutVisitor` methods can filter or even expand to multiple items, but consistency seems nicer.

tracking issue: rust-lang#127615