privacy: Refactor top-level visiting in TypePrivacyVisitor#120284
Merged
bors merged 1 commit intorust-lang:masterfrom Jan 24, 2024
Merged
privacy: Refactor top-level visiting in TypePrivacyVisitor#120284bors merged 1 commit intorust-lang:masterfrom
TypePrivacyVisitor#120284bors merged 1 commit intorust-lang:masterfrom
Conversation
oli-obk
reviewed
Jan 23, 2024
Comment on lines
+49
to
+53
| error: type `Priv` is private | ||
| --> $DIR/private-type-in-interface.rs:28:16 | ||
| | | ||
| LL | fn g() -> impl Tr2<m::Alias> { 0 } | ||
| | ^^^^^^^^^^^^^ private type |
Contributor
There was a problem hiding this comment.
That's a weird almost-duplication and not even the right span, either before or after this change.
The only functional change should have been the generic arg one, and I don't see why checking consts and lifetimes would have an effect here, as there are only traits and types involved.
Any ideas?
Contributor
Author
There was a problem hiding this comment.
Looks like visit_item_likes_in_module includes impl Trait items, and intravisit::walk_mod does not.
Contributor
|
@bors r+ |
Collaborator
fmease
added a commit
to fmease/rust
that referenced
this pull request
Jan 24, 2024
privacy: Refactor top-level visiting in `TypePrivacyVisitor` Full hierarchical visiting (`nested_filter::All`) is not necessary, visiting all item-likes in isolation is enough. Tracking current item is not necessary, just keeping the current `mod` item is enough. `visit_generic_arg` should behave like its default version, including checking types of const arguments. Some comments, including FIXMEs, are also added. Noticed while reading code to review rust-lang#113671. r? `@oli-obk`
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 24, 2024
Rollup of 10 pull requests Successful merges: - rust-lang#114764 ([style edition 2024] Combine all delimited exprs as last argument) - rust-lang#118326 (Add `NonZero*::count_ones`) - rust-lang#118636 (Add the unstable option to reduce the binary size of dynamic library…) - rust-lang#119460 (coverage: Never emit improperly-ordered coverage regions) - rust-lang#119616 (Add a new `wasm32-wasi-preview2` target) - rust-lang#120185 (coverage: Don't instrument `#[automatically_derived]` functions) - rust-lang#120265 (Remove no-system-llvm) - rust-lang#120284 (privacy: Refactor top-level visiting in `TypePrivacyVisitor`) - rust-lang#120285 (Remove extra # from url in suggestion) - rust-lang#120299 (Add mw to review rotation and add some owner assignments) Failed merges: - rust-lang#120124 (Split assembly tests for ELF and MachO) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 24, 2024
Rollup of 9 pull requests Successful merges: - rust-lang#114764 ([style edition 2024] Combine all delimited exprs as last argument) - rust-lang#118326 (Add `NonZero*::count_ones`) - rust-lang#119460 (coverage: Never emit improperly-ordered coverage regions) - rust-lang#119616 (Add a new `wasm32-wasi-preview2` target) - rust-lang#120185 (coverage: Don't instrument `#[automatically_derived]` functions) - rust-lang#120265 (Remove no-system-llvm) - rust-lang#120284 (privacy: Refactor top-level visiting in `TypePrivacyVisitor`) - rust-lang#120285 (Remove extra # from url in suggestion) - rust-lang#120299 (Add mw to review rotation and add some owner assignments) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 24, 2024
Rollup merge of rust-lang#120284 - petrochenkov:typrivisit2, r=oli-obk privacy: Refactor top-level visiting in `TypePrivacyVisitor` Full hierarchical visiting (`nested_filter::All`) is not necessary, visiting all item-likes in isolation is enough. Tracking current item is not necessary, just keeping the current `mod` item is enough. `visit_generic_arg` should behave like its default version, including checking types of const arguments. Some comments, including FIXMEs, are also added. Noticed while reading code to review rust-lang#113671. r? ``@oli-obk``
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jan 26, 2024
…elwoerister privacy: Refactor top-level visiting in `NamePrivacyVisitor` Full hierarchical visiting (`nested_filter::All`) is not necessary, visiting all item-likes in isolation is enough. Tracking current item is not necessary, passing any `HirId` with the same parent module to `adjust_ident_and_get_scope` is enough. Follow up to rust-lang#120284.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 26, 2024
Rollup merge of rust-lang#120339 - petrochenkov:nameprivisit, r=michaelwoerister privacy: Refactor top-level visiting in `NamePrivacyVisitor` Full hierarchical visiting (`nested_filter::All`) is not necessary, visiting all item-likes in isolation is enough. Tracking current item is not necessary, passing any `HirId` with the same parent module to `adjust_ident_and_get_scope` is enough. Follow up to rust-lang#120284.
lnicola
pushed a commit
to lnicola/rust-analyzer
that referenced
this pull request
Apr 7, 2024
privacy: Refactor top-level visiting in `NamePrivacyVisitor` Full hierarchical visiting (`nested_filter::All`) is not necessary, visiting all item-likes in isolation is enough. Tracking current item is not necessary, passing any `HirId` with the same parent module to `adjust_ident_and_get_scope` is enough. Follow up to rust-lang/rust#120284.
RalfJung
pushed a commit
to RalfJung/rust-analyzer
that referenced
this pull request
Apr 27, 2024
privacy: Refactor top-level visiting in `NamePrivacyVisitor` Full hierarchical visiting (`nested_filter::All`) is not necessary, visiting all item-likes in isolation is enough. Tracking current item is not necessary, passing any `HirId` with the same parent module to `adjust_ident_and_get_scope` is enough. Follow up to rust-lang/rust#120284.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Full hierarchical visiting (
nested_filter::All) is not necessary, visiting all item-likes in isolation is enough.Tracking current item is not necessary, just keeping the current
moditem is enough.visit_generic_argshould behave like its default version, including checking types of const arguments.Some comments, including FIXMEs, are also added.
Noticed while reading code to review #113671.
r? @oli-obk