Skip to content

Suppress specified packages' warnings through CLI #16129

@mee7ya

Description

@mee7ya

Problem

Sometimes, working on less than all local packages, I don't want to see warnings from packages I currently do not work with. Additionally, having less warnings in total makes tools like rust-analyzer run faster, since they don't have process "uninteresting" errors

Currently, cargo will output all warnings produced by rustc from locally defined packages. And, as far as I understand, the only way to disable those warnings is by using #[allow(warnings)] attribute in lib.rs, which is not convenient

Proposed Solution

Add --allow-warnings argument to cargo check, cargo build, etc. to suppress output of specified packages' warnings

Notes

Possible implementation db966b5

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-needs-infoStatus: Needs more info, such as a reproduction or more background for a feature request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions