Skip to content
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

Use -D warnings instead of deny-warnings feature. #13225

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ env:
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
NO_FMT_TEST: 1
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings

concurrency:
# For a given workflow, if we push to the same PR, cancel all previous builds on that PR.
Expand All @@ -47,25 +48,25 @@ jobs:

# Run
- name: Build
run: cargo build --tests --features deny-warnings,internal
run: cargo build --tests --features internal

- name: Test
run: cargo test --features deny-warnings,internal
run: cargo test --features internal

- name: Test clippy_lints
run: cargo test --features deny-warnings,internal
run: cargo test --features internal
working-directory: clippy_lints

- name: Test clippy_utils
run: cargo test --features deny-warnings
run: cargo test
working-directory: clippy_utils

- name: Test rustc_tools_util
run: cargo test --features deny-warnings
run: cargo test
working-directory: rustc_tools_util

- name: Test clippy_dev
run: cargo test --features deny-warnings
run: cargo test
working-directory: clippy_dev

- name: Test clippy-driver
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/clippy_bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
NO_FMT_TEST: 1
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings

concurrency:
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
Expand Down Expand Up @@ -85,34 +86,34 @@ jobs:

# Run
- name: Build
run: cargo build --tests --features deny-warnings,internal
run: cargo build --tests --features internal

- name: Test
if: matrix.host == 'x86_64-unknown-linux-gnu'
run: cargo test --features deny-warnings,internal
run: cargo test --features internal

- name: Test
if: matrix.host != 'x86_64-unknown-linux-gnu'
run: cargo test --features deny-warnings,internal -- --skip dogfood
run: cargo test --features internal -- --skip dogfood

- name: Test clippy_lints
run: cargo test --features deny-warnings,internal
run: cargo test --features internal
working-directory: clippy_lints

- name: Test clippy_utils
run: cargo test --features deny-warnings
run: cargo test
working-directory: clippy_utils

- name: Test clippy_config
run: cargo test --features deny-warnings
run: cargo test
working-directory: clippy_config

- name: Test rustc_tools_util
run: cargo test --features deny-warnings
run: cargo test
working-directory: rustc_tools_util

- name: Test clippy_dev
run: cargo test --features deny-warnings
run: cargo test
working-directory: clippy_dev

- name: Test clippy-driver
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/clippy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings

jobs:
clippy_dev:
Expand All @@ -28,7 +29,7 @@ jobs:

# Run
- name: Build
run: cargo build --features deny-warnings
run: cargo build
working-directory: clippy_dev

- name: Test update_lints
Expand All @@ -38,6 +39,8 @@ jobs:
run: cargo dev fmt --check

- name: Test cargo dev new lint
env:
RUSTFLAGS: -A unused-imports
run: |
cargo dev new_lint --name new_early_pass --pass early
cargo dev new_lint --name new_late_pass --pass late
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ tokio = { version = "1", features = ["io-util"] }
rustc_tools_util = "0.3.0"

[features]
deny-warnings = ["clippy_lints/deny-warnings"]
integration = ["tempfile"]
internal = ["clippy_lints/internal", "tempfile"]

Expand Down
3 changes: 0 additions & 3 deletions clippy_config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ toml = "0.7.3"
[dev-dependencies]
walkdir = "2.3"

[features]
deny-warnings = []

[package.metadata.rust-analyzer]
# This crate uses #[feature(rustc_private)]
rustc_private = true
1 change: 0 additions & 1 deletion clippy_config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(rustc_private, array_windows, let_chains)]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(
trivial_casts,
trivial_numeric_casts,
Expand Down
3 changes: 0 additions & 3 deletions clippy_dev/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ opener = "0.6"
shell-escape = "0.1"
walkdir = "2.3"

[features]
deny-warnings = []

[package.metadata.rust-analyzer]
# This package uses #[feature(rustc_private)]
rustc_private = true
1 change: 0 additions & 1 deletion clippy_dev/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![feature(let_chains)]
#![feature(rustc_private)]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(
trivial_casts,
trivial_numeric_casts,
Expand Down
1 change: 0 additions & 1 deletion clippy_dev/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
// warn on lints, that are included in `rust-lang/rust`s bootstrap
#![warn(rust_2018_idioms, unused_lifetimes)]

Expand Down
1 change: 0 additions & 1 deletion clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ url = "2.2"
walkdir = "2.3"

[features]
deny-warnings = ["clippy_config/deny-warnings", "clippy_utils/deny-warnings"]
# build clippy with internal lints enabled, off by default
internal = ["serde_json", "tempfile", "regex"]

Expand Down
1 change: 0 additions & 1 deletion clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#![feature(stmt_expr_attributes)]
#![feature(unwrap_infallible)]
#![recursion_limit = "512"]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![allow(
clippy::missing_docs_in_private_items,
clippy::must_use_candidate,
Expand Down
3 changes: 0 additions & 3 deletions clippy_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ rustc-semver = "1.1"
# FIXME(f16_f128): remove when no longer needed for parsing
rustc_apfloat = "0.2.0"

[features]
deny-warnings = ["clippy_config/deny-warnings"]

[package.metadata.rust-analyzer]
# This crate uses #[feature(rustc_private)]
rustc_private = true
1 change: 0 additions & 1 deletion clippy_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#![feature(assert_matches)]
#![feature(unwrap_infallible)]
#![recursion_limit = "512"]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![allow(
clippy::missing_errors_doc,
clippy::missing_panics_doc,
Expand Down
3 changes: 0 additions & 3 deletions declare_clippy_lint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ proc-macro = true
itertools = "0.12"
quote = "1.0.21"
syn = "2.0"

[features]
deny-warnings = []
1 change: 0 additions & 1 deletion declare_clippy_lint/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(let_chains)]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
// warn on lints, that are included in `rust-lang/rust`s bootstrap
#![warn(rust_2018_idioms, unused_lifetimes)]

Expand Down
3 changes: 0 additions & 3 deletions lintcheck/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,3 @@ tar = "0.4"
toml = "0.7.3"
ureq = { version = "2.2", features = ["json"] }
walkdir = "2.3"

[features]
deny-warnings = []
3 changes: 0 additions & 3 deletions rustc_tools_util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ categories = ["development-tools"]
edition = "2018"

[dependencies]

[features]
deny-warnings = []
2 changes: 0 additions & 2 deletions rustc_tools_util/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg_attr(feature = "deny-warnings", deny(warnings))]

use std::str;

/// This macro creates the version string during compilation from the
Expand Down
1 change: 0 additions & 1 deletion src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#![allow(rustc::untranslatable_diagnostic)]
#![feature(rustc_private)]
#![feature(let_chains)]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
// warn on lints, that are included in `rust-lang/rust`s bootstrap
#![warn(rust_2018_idioms, unused_lifetimes)]
// warn on rustc internal lints
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
// warn on lints, that are included in `rust-lang/rust`s bootstrap
#![warn(rust_2018_idioms, unused_lifetimes)]

Expand Down
1 change: 0 additions & 1 deletion tests/check-fmt.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(rust_2018_idioms, unused_lifetimes)]

use std::path::PathBuf;
Expand Down
1 change: 0 additions & 1 deletion tests/compile-test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(is_sorted)]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(rust_2018_idioms, unused_lifetimes)]
#![allow(unused_extern_crates)]

Expand Down
1 change: 0 additions & 1 deletion tests/dogfood.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//!
//! See [Eating your own dog food](https://en.wikipedia.org/wiki/Eating_your_own_dog_food) for context

#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(rust_2018_idioms, unused_lifetimes)]

use itertools::Itertools;
Expand Down
1 change: 0 additions & 1 deletion tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
//! Clippy doesn't produce an ICE. Lint warnings are ignored by this test.

#![cfg(feature = "integration")]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(rust_2018_idioms, unused_lifetimes)]

use std::env;
Expand Down
1 change: 0 additions & 1 deletion tests/lint_message_convention.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(rust_2018_idioms, unused_lifetimes)]

use std::ffi::OsStr;
Expand Down
1 change: 0 additions & 1 deletion tests/missing-test-files.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(rust_2018_idioms, unused_lifetimes)]
#![allow(clippy::assertions_on_constants)]
#![feature(path_file_prefix)]
Expand Down
1 change: 0 additions & 1 deletion tests/versioncheck.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(rust_2018_idioms, unused_lifetimes)]
#![allow(clippy::single_match_else)]

Expand Down
3 changes: 3 additions & 0 deletions tests/workspace_test/path_dep/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[package]
name = "path_dep"
version = "0.1.0"

[features]
primary_package_test = []