Skip to content

is there a way to disable seeing warnings if there are errors blocking compilation? #80863

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

Closed
alok opened this issue Jan 10, 2021 · 8 comments
Closed
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-feature-request Category: A feature request, i.e: not implemented / a PR. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@alok
Copy link

alok commented Jan 10, 2021

most of the time, if i have compile error(s), i want to see only that error. warnings take up my attention needlessly.

could this be a command line flag or an option to how error format is set now?

@gyfis
Copy link

gyfis commented Jan 10, 2021

@alok it seems using RUSTFLAGS=-Awarnings with cargo build hides warnings. Not conditionally, and it leads to recompile it seems, but maybe that's enough for you.

@jyn514
Copy link
Member

jyn514 commented Jan 10, 2021

You could also use cargo rustc -- -Awarnings which doesn't recompile, but can only build one crate.

@jyn514 jyn514 added the C-feature-request Category: A feature request, i.e: not implemented / a PR. label Jan 10, 2021
@alok
Copy link
Author

alok commented Jan 10, 2021

i’m actually looking for the conditional behavior since it automates a common workflow: first make it work (no errors), then make it work well (no warnings).

@jyn514
Copy link
Member

jyn514 commented Jan 10, 2021

@alok you may be interested in https://github.com/Canop/bacon/

@camelid camelid added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 11, 2021
@rcolomina
Copy link

RUSTFLAGS=-Awarnings flag works for me removing all the warnings. I am most interested on errors rather than warnings. When you provide this a flag, all cranes are re-complied.

@blueforesticarus
Copy link

Whether or not warnings are printed should have nothing to do with whether you need to recompile smh

@SamB
Copy link

SamB commented Sep 18, 2023

You don't think that you might end up missing out on warning messages that actually explain the circumstances that lead to the error? Say, a warning on a likely-problematic declaration and an error on the attempt to use whatever was declared?

@Dylan-DPC
Copy link
Member

Closing this as i'm not sure there's much to be done here in a way that doesn't have concerns and there are alternatives present as listed above.

@Dylan-DPC Dylan-DPC closed this as not planned Won't fix, can't repro, duplicate, stale Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-feature-request Category: A feature request, i.e: not implemented / a PR. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants