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

Limit exported-private-dependencies lints to libraries #13039

Closed
Tracked by #44663
epage opened this issue Nov 22, 2023 · 3 comments
Closed
Tracked by #44663

Limit exported-private-dependencies lints to libraries #13039

epage opened this issue Nov 22, 2023 · 3 comments
Assignees
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review Z-public-dependency Nightly: public-dependency

Comments

@epage
Copy link
Contributor

epage commented Nov 22, 2023

Problem

When developing bins or tests, the use of a dependency in a pub item doesn't actually make it a public dependency.

Proposed Solution

Restrict which targets use -extern priv:

Notes

No response

@epage epage added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review Z-public-dependency Nightly: public-dependency labels Nov 22, 2023
@linyihai
Copy link
Contributor

linyihai commented Dec 5, 2023

@rustbot claim

@epage
Copy link
Contributor Author

epage commented Dec 5, 2023

FYI likely the first step is adding tests like https://github.com/rust-lang/cargo/blob/master/tests/testsuite/pub_priv.rs#L7 to cover tests, bins, build scripts, benches, examples, etc. If we need updating, the code is at https://github.com/rust-lang/cargo/blob/master/src/cargo/core/compiler/mod.rs#L1430

bors added a commit that referenced this issue Dec 11, 2023
Limit exported-private-dependencies lints to libraries

### What does this PR try to resolve?
Completed #13039.

This PR limit `exported-private-dependencies`  lint in libraray `Target`.

### How should we test and review this PR?

Your can checkout out 2348ac2 and run test, it will failed and then it will be passed in the commit 2348ac2

### Additional information
@epage
Copy link
Contributor Author

epage commented Dec 11, 2023

Closed via #13135

@epage epage closed this as completed Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review Z-public-dependency Nightly: public-dependency
Projects
None yet
Development

No branches or pull requests

2 participants