-
-
Notifications
You must be signed in to change notification settings - Fork 16.1k
Private dependencies in public interface lint rework #160726
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
Open
mladedav
wants to merge
7
commits into
rust-lang:main
Choose a base branch
from
mladedav:dm/public-dependencies-shallow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+338
−208
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e1cb6fc
Queries: add `is_direct_public_dep` query
mladedav a0cf0d2
resolve: save information from which crate a path imports items
mladedav 282b106
privacy: add new visitor for hir walking for private dependencies in …
mladedav f88b243
privacy: do not emit exported private dependencies lints from old def…
mladedav 89bead9
privacy: fix typo
mladedav c6a9c3f
Update public dependencies tests
mladedav c35759e
expand public dependency tests to cover both absolute paths and impor…
mladedav File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4669,7 +4669,6 @@ dependencies = [ | |
| "rustc_middle", | ||
| "rustc_span", | ||
| "rustc_ty_walk", | ||
| "tracing", | ||
| ] | ||
|
|
||
| [[package]] | ||
|
|
||
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2388,6 +2388,16 @@ rustc_queries! { | |
| desc { "checking whether crate `{}` is a private dependency", c } | ||
| separate_provide_extern | ||
| } | ||
| /// Returns whether or not the crate with CrateNum 'cnum' | ||
| /// is marked as a direct public dependency | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment should be updated (first implementation used a direct public dep query, now it's extern priv query) |
||
| query is_extern_private_dep(c: CrateNum) -> bool { | ||
| eval_always | ||
| desc { "checking whether crate `{}` is a direct public dependency", c } | ||
| separate_provide_extern | ||
| } | ||
| query paths_from_private_deps(key: hir::OwnerId) -> Option<&'tcx SortedMap<hir::ItemLocalId, CrateNum>> { | ||
| desc { "getting paths imported from private dependencies in `{}`", tcx.def_path_str(key) } | ||
| } | ||
| query allocator_kind(_: ()) -> Option<AllocatorKind> { | ||
| eval_always | ||
| desc { "getting the allocator kind for the current crate" } | ||
|
|
||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this flag obsoleted by
is_extern_private_dep?It would be pretty bad to have the both systems in place.
View changes since the review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was still used in the other privacy visitor and I wasn't sure so since it has slightly different semantics, I thought it safer to just keep it.
I'll try to see what actually uses it and if it can be safely replaced.