-
Notifications
You must be signed in to change notification settings - Fork 1
[DISCUSS] Method of #![deny(current_warnings)] #1
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
Comments
I personally exclusively develop with warnings on :) An alternative method for allowing both is a
|
As you mention, with I'm going to be writing up an RFC for warning groups to be split in two, normal and |
In preparing for writing my RFC, I've been giving this more thought, including workarounds and alternative approaches. One alternative is to do: matrix:
include:
- rust: 1.24.0 # Locking down for consistent behavior
env: RUSTFLAGS=-D warnings
install:
script:
- cargo check --tests Pros
Cons
Thoughts? |
A generic Pinning to a compiler version has the benefit of also eliminating problems with other forms of warning creep. Bumping CI requirements should be done in the repository history along with necessary fixes for the bumped requirements (if as simple as |
I also decided to ping "users" about it before I wrote up an RFC https://users.rust-lang.org/t/handling-warnings-in-a-ci/15669 Even if the RFC happens, it'll probably be worthwhile to switch to the pinned compiler until stable groups are available. |
I find this tower annoying:
example-warn/src/lib.rs
Lines 1 to 36 in 5cbaf77
Reasoning:
I fully agree that warnings should be treated as errors on CI. So how do we get
cargo build
to treat warnings as errors? By theRUSTFLAGS
environment variable!With
RUSTFLAGS=-D warnings
you can deny the warning groupwarnings
. (For the same reason that we don't use!#[deny(warnings)]
, this is dangerous. Though we're still technically not free from warnings introduced by new versions of the compiler; deprecation of symbols can introduce deprecation warnings. (As such that one should probably be excluded from our exclusion list.)) WithRUSTFLAGS=-D const_err -D dead_code ...
you can specify warning (groups) individually.The text was updated successfully, but these errors were encountered: