-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
exported_private_dependencies lint only take effect in innermost dependency #119428
Copy link
Copy link
Open
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-visibilityArea: Visibility / privacyArea: Visibility / privacyC-bugCategory: This is a bug.Category: This is a bug.F-public_private_dependenciesfeature: public_private_dependenciesfeature: public_private_dependenciesL-exported_private_dependenciesLint: exported_private_dependenciesLint: exported_private_dependenciesT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-visibilityArea: Visibility / privacyArea: Visibility / privacyC-bugCategory: This is a bug.Category: This is a bug.F-public_private_dependenciesfeature: public_private_dependenciesfeature: public_private_dependenciesL-exported_private_dependenciesLint: exported_private_dependenciesLint: exported_private_dependenciesT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
The
exported_private_dependencieslint only take affect in the innermost dependency in a recursively dependent environment.This inspired by #44663 (comment).
Steps
In order to prove this problem, I purposely contructed a code repository, here
in the repository, the
cratesfolder has three crates,grandparent_depas public and reexport pub struct from grandparent_depparent_depas public and reexport pub struct from parent_dep(the crates in
cratescan be treated as download from respority(like github, crates.io))in src/lib.rs, add
pub_depas dependency but private.After downloading the resposity,
1、 run
cargo build, no lint warning message2、 change the
public = falseincrates/pub_dep/Cargo.toml, then runcargo build, no lint warning message3、 change the
public = falseincrates/parent_dep/Cargo.toml, runcargo buildand a lint warning message comes up.Possible Solution(s)
The focus of this issue is to verify whether there is a problem with the current situation, so the solution will not be considered for the time being.
Notes
No response
Version