Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The rustc_hir::intravisit::Visitor trait documentation mentions ItemLikeVisitor that was removed #114885

Open
disconnect3d opened this issue Aug 16, 2023 · 2 comments
Assignees
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools E-help-wanted Call for participation: Help is requested to fix this issue.

Comments

@disconnect3d
Copy link

disconnect3d commented Aug 16, 2023

Hi,

The documentation for the rustc_hir::intravisit::Visitor trait mentions an itemlikevisitor::ItemLikeVisitor pattern that does not exist in the codebase anymore.

Here is the outdated doc page: https://doc.rust-lang.org/beta/nightly-rustc/rustc_hir/intravisit/trait.Visitor.html

Or here are exactly the places in the code where the outdated texts occur:

/// See the comments on `ItemLikeVisitor` for more details on the overall
/// visit strategy.
pub trait NestedFilter<'hir> {

And:

/// Invoked when a nested item is encountered. By default, when
/// `Self::NestedFilter` is `nested_filter::None`, this method does
/// nothing. **You probably don't want to override this method** --
/// instead, override [`Self::NestedFilter`] or use the "shallow" or
/// "deep" visit patterns described on
/// `itemlikevisit::ItemLikeVisitor`. The only reason to override
/// this method is if you want a nested pattern but cannot supply a
/// [`Map`]; see `nested_visit_map` for advice.
fn visit_nested_item(&mut self, id: ItemId) {

The itemlikevisitor::ItemLikeVisitor pattern was removed in the 93616dd commit by @kckeiks.

It would be nice to update the documentation on what should we use now in place of ItemLikeVisitor. I don't have that knowledge yet and I am not sure if I manage to find that out myself to improve that documentation.

@disconnect3d disconnect3d added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Aug 16, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 16, 2023
@compiler-errors compiler-errors added E-help-wanted Call for participation: Help is requested to fix this issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 16, 2023
@kusabana
Copy link
Contributor

kusabana commented Sep 5, 2023

@rustbot claim

bors added a commit to rust-lang-ci/rust that referenced this issue Sep 6, 2023
…ency, r=compiler-errors

replace doc occurrences of ItemLikeVisitor

Solves rust-lang#114885

ItemLikeVisitor used to have comments describing visit patterns. After it was removed, it was moved to `rustc_hir::intravisit` but references in `intravisit.rs` weren't updated.
@kusabana
Copy link
Contributor

kusabana commented Sep 6, 2023

This was resolved with #115584, i was just not aware of the keywords needed to link the issue at the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools E-help-wanted Call for participation: Help is requested to fix this issue.
Projects
None yet
Development

No branches or pull requests

4 participants