diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-03-07 17:02:33 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-03-07 19:35:41 +1100 |
| commit | 872ac73f59465ccaf63f74fd12785c583d3aa0a6 (patch) | |
| tree | c8565366c840b5bf5ca1e44dde5641c001e57849 /compiler/rustc_middle/src | |
| parent | 98a48781feb1220c0cf2feea23f9ef92cdfa7437 (diff) | |
| download | rust-872ac73f59465ccaf63f74fd12785c583d3aa0a6.tar.gz rust-872ac73f59465ccaf63f74fd12785c583d3aa0a6.zip | |
Move `visit_id` calls.
In `walk_item`, we call `visit_id` on every item kind. For most of them we do it directly in `walk_item`. But for `ItemKind::Mod`, `ItemKind::Enum`, and `ItemKind::Use` we instead do it in the `walk_*` function called (via the `visit_*` function) from `walk_item`. I can see no reason for this inconsistency, so this commit makes those three cases like all the other cases, moving the `visit_id` calls into `walk_item`. This also avoids the need for a few `HirId` arguments.
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/hir/map.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/hir/map.rs b/compiler/rustc_middle/src/hir/map.rs index fad8c7dcbcb..c85af81ee25 100644 --- a/compiler/rustc_middle/src/hir/map.rs +++ b/compiler/rustc_middle/src/hir/map.rs @@ -1356,7 +1356,7 @@ impl<'hir> Visitor<'hir> for ItemCollector<'hir> { self.submodules.push(item.owner_id); // A module collector does not recurse inside nested modules. if self.crate_collector { - intravisit::walk_mod(self, module, item.hir_id()); + intravisit::walk_mod(self, module); } } else { intravisit::walk_item(self, item) |
