rust/tests/ui-fulldeps
bors c2ec7532ee Auto merge of #142706 - fee1-dead-contrib:push-zsznlqyrzsqo, r=oli-obk
completely deduplicate `Visitor` and `MutVisitor`

r? oli-obk

This closes rust-lang/rust#127615.

### Discussion

> * Give every `MutVisitor::visit_*` method a corresponding `flat_map_*` method.

Not every AST node exists in a location where they can be mapped to multiple instances of themselves. Not every AST node exists in a location where they can be removed from existence (e.g. `filter_map_expr`). I don't think this is doable.

> * Give every `MutVisitor::visit_*` method a corresponding `Visitor` method and vice versa

The only three remaining method-level asymmetries after this PR are `visit_stmt` and `visit_nested_use_tree` (only on `Visitor`) and `visit_span` (only on `MutVisitor`).

`visit_stmt` doesn't seem applicable to `MutVisitor` because `walk_flat_map_stmt_kind` will ask `flat_map_item` / `filter_map_expr` to potentially turn a single `Stmt` to multiple based on what a visitor wants. So only using `flat_map_stmt` seems appropriate.

`visit_nested_use_tree` is used for `rustc_resolve` to track stuff. Not useful for `MutVisitor` for now.

`visit_span` is currently not used for `MutVisitor` already, it was just kept in case we want to revive rust-lang/rust#127241. cc `@cjgillot` maybe we could remove for now and re-insert later if we find a use-case? It does involve some extra effort to maintain.

* Remaining FIXMEs

`visit_lifetime` has an extra param for `Visitor` that's not in `MutVisitor`. This is again something only used by `rustc_resolve`. I think we can keep that symmetry for now.
2025-06-22 14:03:44 +00:00
..
auxiliary Add AST pretty-printer tests involving attr precedence 2025-06-13 13:59:21 -07:00
codegen-backend Move metadata object generation for dylibs to the linker code 2025-06-03 10:04:34 +00:00
fluent-messages Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
internal-lints Implement lint against direct uses of rustc_type_ir in compiler crates 2025-06-18 16:01:41 +02:00
lexer Add test to check unicode identifier version 2024-12-09 06:23:59 -08:00
mod_dir_simple [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
session-diagnostic Detect when attribute is provided by missing derive macro 2025-06-12 21:28:49 +00:00
stable-mir Fix test description 2025-06-16 10:51:59 +03:00
try-from-u32 UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
compiler-calls.rs Remove RunCompiler 2025-01-23 09:38:58 +00:00
deriving-global.rs Improve dead code analysis 2024-07-04 22:05:00 +08:00
deriving-hygiene.rs Improve dead code analysis 2024-07-04 22:05:00 +08:00
dropck-tarena-cycle-checked.rs Remove ignore-stage1 that was added when changing error count msg 2024-01-06 12:53:06 +01:00
dropck-tarena-cycle-checked.stderr Remove ignore-stage1 that was added when changing error count msg 2024-01-06 12:53:06 +01:00
dropck-tarena-unsound-drop.rs Remove ignore-stage1 that was added when changing error count msg 2024-01-06 12:53:06 +01:00
dropck-tarena-unsound-drop.stderr Remove ignore-stage1 that was added when changing error count msg 2024-01-06 12:53:06 +01:00
dropck_tarena_sound_drop.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
empty-struct-braces-derive.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
hash-stable-is-unstable.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
hash-stable-is-unstable.stderr Revert "Don't test new error messages with the stage 0 compiler" 2025-03-08 22:45:16 +02:00
lint-pass-macros.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
missing-rustc-driver-error.rs UI tests: migrate remaining compile time error-patterns to line annotations 2025-04-13 21:48:53 +03:00
missing-rustc-driver-error.stderr Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
mod_dir_path_canonicalized.rs Make top-level rustc_parse functions fallible. 2024-06-05 10:38:03 +10:00
obtain-borrowck.rs Move some Map methods onto TyCtxt. 2025-02-17 13:21:02 +11:00
obtain-borrowck.run.stdout Port tests/run-make-fulldeps/obtain-borrowck to ui-fulldeps 2024-06-07 00:41:31 +10:00
pathless-extern-unstable.rs Revert "Don't test new error messages with the stage 0 compiler" 2025-03-08 22:45:16 +02:00
pathless-extern-unstable.stderr Revert "Don't test new error messages with the stage 0 compiler" 2025-03-08 22:45:16 +02:00
pprust-expr-roundtrip.rs avoid &mut P<T> in visit_expr etc methods 2025-06-12 17:36:03 +08:00
pprust-parenthesis-insertion.rs Add an attribute-related parenthesization edge case 2025-06-20 13:49:12 -07:00
regions-mock-tcx.rs Use the rustc_private libc less in tests 2024-04-15 08:54:11 -04:00
run-compiler-twice.rs Allow drivers to supply a list of extra symbols to intern 2025-04-10 13:39:23 +00:00
rustc-dev-remap.only-remap.stderr completely deduplicate Visitor and MutVisitor 2025-06-19 17:50:44 +08:00
rustc-dev-remap.remap-unremap.stderr completely deduplicate Visitor and MutVisitor 2025-06-19 17:50:44 +08:00
rustc-dev-remap.rs Un-remap rustc-dev component paths 2025-06-15 17:20:08 +02:00
rustc_encodable_hygiene.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00