Skip to content

Commit 629c32d

Browse files
committed
chore: Deny warnings across entire cargo repo
1 parent dca10d1 commit 629c32d

File tree

6 files changed

+5
-11
lines changed

6 files changed

+5
-11
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
CARGO_PROFILE_TEST_DEBUG: 1
3636
CARGO_INCREMENTAL: 0
3737
CARGO_PUBLIC_NETWORK_TESTS: 1
38+
# Deny warnings on CI to avoid warnings getting into the codebase.
39+
RUSTFLAGS: -D warnings
3840
strategy:
3941
matrix:
4042
include:
@@ -85,8 +87,7 @@ jobs:
8587
run: echo CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse >> $GITHUB_ENV
8688
if: "!contains(matrix.rust, 'stable')"
8789

88-
# Deny warnings on CI to avoid warnings getting into the codebase.
89-
- run: cargo test --features 'deny-warnings'
90+
- run: cargo test
9091
# The testsuite generates a huge amount of data, and fetch-smoke-test was
9192
# running out of disk space.
9293
- name: Clear test output
@@ -100,8 +101,8 @@ jobs:
100101
run: |
101102
# This only tests `cargo fix` because fix-proxy-mode is one of the most
102103
# complicated subprocess management in Cargo.
103-
cargo test --test testsuite --features 'deny-warnings' -- fix::
104-
- run: cargo test --features 'deny-warnings' --manifest-path crates/cargo-test-support/Cargo.toml
104+
cargo test --test testsuite -- fix::
105+
- run: cargo test --features --manifest-path crates/cargo-test-support/Cargo.toml
105106
env:
106107
CARGO_TARGET_DIR: target
107108
- run: cargo test -p cargo-platform

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ test = false
112112
doc = false
113113

114114
[features]
115-
deny-warnings = []
116115
vendored-openssl = ["openssl/vendored"]
117116
vendored-libgit2 = ["libgit2-sys/vendored"]
118117
pretty-env-logger = ["pretty_env_logger"]

crates/cargo-test-support/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,3 @@ url = "2.2.2"
3030

3131
[target.'cfg(windows)'.dependencies]
3232
windows-sys = { version = "0.45.0", features = ["Win32_Storage_FileSystem"] }
33-
34-
[features]
35-
deny-warnings = []

crates/cargo-test-support/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//! See <https://rust-lang.github.io/cargo/contrib/> for a guide on writing tests.
44
55
#![allow(clippy::all)]
6-
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
76

87
use std::env;
98
use std::ffi::OsStr;

src/cargo/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// For various reasons, some idioms are still allow'ed, but we would like to
22
// test and enforce them.
33
#![warn(rust_2018_idioms)]
4-
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
54
// Due to some of the default clippy lints being somewhat subjective and not
65
// necessarily an improvement, we prefer to not use them at this time.
76
#![allow(clippy::all)]

tests/testsuite/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// See src/cargo/lib.rs for notes on these lint settings.
22
#![warn(rust_2018_idioms)]
33
#![allow(clippy::all)]
4-
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
54

65
#[macro_use]
76
extern crate cargo_test_macro;

0 commit comments

Comments
 (0)