Skip to content

Limit exported-private-dependencies lints to libraries #13039

Closed

Description

@epage

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

Activity

  1. added
    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
    S-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review
    on Nov 22, 2023
  2. linyihai commented on Dec 5, 2023

    @linyihai
    Contributor

    @rustbot claim

  3. epage commented on Dec 5, 2023

    @epage
    ContributorAuthor

    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

  4. added a commit that references this issue on Dec 11, 2023
  5. epage commented on Dec 11, 2023

    @epage
    ContributorAuthor

    Closed via #13135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewZ-public-dependencyNightly: public-dependency

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions