Skip to content

Add Cargo.toml context to exported-private-dependencies lints #13096

Open
@epage

Description

@epage

Problem

Right now the lint just says

warning: trait `FooTrait` from private dependency 'foo' in public interface
  --> src/lib.rs:25:1
   |
25 | pub fn use_foo_trait<F: foo::FooTrait>(_: Local) {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

rustc has no knowledge of Cargo.toml to provide additional context

Proposed Solution

Build on #13095 and #12235 to inject a note in the lint to highlight the dependency in Cargo.toml, saying the dependency is private

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Error and warning messages generated by Cargo itself.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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions