From d77faa68afde2662caddf83f3974ed8b512d1162 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Thu, 11 Apr 2024 14:36:30 -0600 Subject: [PATCH] refactor: Remove `rust_2024_compatibility` lint group --- src/cargo/util/lints.rs | 9 +---- tests/testsuite/lints/mod.rs | 1 - .../edition_2021/mod.rs | 34 ----------------- .../edition_2021_warn/mod.rs | 37 ------------------ .../edition_2021_warn/stderr.term.svg | 38 ------------------- .../edition_2024/mod.rs | 34 ----------------- .../edition_2024/stderr.term.svg | 38 ------------------- .../lints/rust_2024_compatibility/mod.rs | 4 -- .../lints/rust_2024_compatibility/warn/mod.rs | 38 ------------------- .../warn/stderr.term.svg | 38 ------------------- 10 files changed, 1 insertion(+), 270 deletions(-) delete mode 100644 tests/testsuite/lints/rust_2024_compatibility/edition_2021/mod.rs delete mode 100644 tests/testsuite/lints/rust_2024_compatibility/edition_2021_warn/mod.rs delete mode 100644 tests/testsuite/lints/rust_2024_compatibility/edition_2021_warn/stderr.term.svg delete mode 100644 tests/testsuite/lints/rust_2024_compatibility/edition_2024/mod.rs delete mode 100644 tests/testsuite/lints/rust_2024_compatibility/edition_2024/stderr.term.svg delete mode 100644 tests/testsuite/lints/rust_2024_compatibility/mod.rs delete mode 100644 tests/testsuite/lints/rust_2024_compatibility/warn/mod.rs delete mode 100644 tests/testsuite/lints/rust_2024_compatibility/warn/stderr.term.svg diff --git a/src/cargo/util/lints.rs b/src/cargo/util/lints.rs index f2291f1b2..89a156a47 100644 --- a/src/cargo/util/lints.rs +++ b/src/cargo/util/lints.rs @@ -66,13 +66,6 @@ pub struct LintGroup { pub edition_lint_opts: Option<(Edition, LintLevel)>, } -const RUST_2024_COMPATIBILITY: LintGroup = LintGroup { - name: "rust_2024_compatibility", - default_level: LintLevel::Allow, - desc: "warn about compatibility with Rust 2024", - edition_lint_opts: Some((Edition::Edition2024, LintLevel::Deny)), -}; - #[derive(Copy, Clone, Debug)] pub struct Lint { pub name: &'static str, @@ -152,7 +145,7 @@ impl From for LintLevel { const IMPLICIT_FEATURES: Lint = Lint { name: "implicit_features", desc: "warn about the use of unstable features", - groups: &[RUST_2024_COMPATIBILITY], + groups: &[], default_level: LintLevel::Allow, edition_lint_opts: Some((Edition::Edition2024, LintLevel::Deny)), }; diff --git a/tests/testsuite/lints/mod.rs b/tests/testsuite/lints/mod.rs index 600122e61..0ba226df6 100644 --- a/tests/testsuite/lints/mod.rs +++ b/tests/testsuite/lints/mod.rs @@ -1,2 +1 @@ mod implicit_features; -mod rust_2024_compatibility; diff --git a/tests/testsuite/lints/rust_2024_compatibility/edition_2021/mod.rs b/tests/testsuite/lints/rust_2024_compatibility/edition_2021/mod.rs deleted file mode 100644 index ec43952e2..000000000 --- a/tests/testsuite/lints/rust_2024_compatibility/edition_2021/mod.rs +++ /dev/null @@ -1,34 +0,0 @@ -use cargo_test_support::prelude::*; -use cargo_test_support::project; -use cargo_test_support::registry::Package; -use cargo_test_support::str; - -#[cargo_test] -fn case() { - Package::new("bar", "0.1.0").publish(); - let p = project() - .file( - "Cargo.toml", - r#" -[package] -name = "foo" -version = "0.1.0" -edition = "2021" - -[dependencies] -bar = { version = "0.1.0", optional = true } -"#, - ) - .file("src/lib.rs", "") - .build(); - - snapbox::cmd::Command::cargo_ui() - .masquerade_as_nightly_cargo(&["always_nightly"]) - .current_dir(p.root()) - .arg("check") - .arg("--quiet") - .assert() - .success() - .stdout_matches(str![""]) - .stderr_matches(str![""]); -} diff --git a/tests/testsuite/lints/rust_2024_compatibility/edition_2021_warn/mod.rs b/tests/testsuite/lints/rust_2024_compatibility/edition_2021_warn/mod.rs deleted file mode 100644 index 1c965df37..000000000 --- a/tests/testsuite/lints/rust_2024_compatibility/edition_2021_warn/mod.rs +++ /dev/null @@ -1,37 +0,0 @@ -use cargo_test_support::prelude::*; -use cargo_test_support::registry::Package; -use cargo_test_support::str; -use cargo_test_support::{file, project}; - -#[cargo_test] -fn case() { - Package::new("bar", "0.1.0").publish(); - let p = project() - .file( - "Cargo.toml", - r#" -[package] -name = "foo" -version = "0.1.0" -edition = "2021" - -[dependencies] -bar = { version = "0.1.0", optional = true } - -[lints.cargo] -rust-2024-compatibility = "warn" -"#, - ) - .file("src/lib.rs", "") - .build(); - - snapbox::cmd::Command::cargo_ui() - .masquerade_as_nightly_cargo(&["always_nightly"]) - .current_dir(p.root()) - .arg("check") - .arg("--quiet") - .assert() - .success() - .stdout_matches(str![""]) - .stderr_matches(file!["stderr.term.svg"]); -} diff --git a/tests/testsuite/lints/rust_2024_compatibility/edition_2021_warn/stderr.term.svg b/tests/testsuite/lints/rust_2024_compatibility/edition_2021_warn/stderr.term.svg deleted file mode 100644 index e41fb2b35..000000000 --- a/tests/testsuite/lints/rust_2024_compatibility/edition_2021_warn/stderr.term.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - warning: unused optional dependency - - --> Cargo.toml:8:1 - - | - - 8 | bar = { version = "0.1.0", optional = true } - - | --- - - | - - - - - - diff --git a/tests/testsuite/lints/rust_2024_compatibility/edition_2024/mod.rs b/tests/testsuite/lints/rust_2024_compatibility/edition_2024/mod.rs deleted file mode 100644 index f17121b99..000000000 --- a/tests/testsuite/lints/rust_2024_compatibility/edition_2024/mod.rs +++ /dev/null @@ -1,34 +0,0 @@ -use cargo_test_support::prelude::*; -use cargo_test_support::registry::Package; -use cargo_test_support::str; -use cargo_test_support::{file, project}; - -#[cargo_test(nightly, reason = "edition2024 is not stable")] -fn case() { - Package::new("bar", "0.1.0").publish(); - let p = project() - .file( - "Cargo.toml", - r#" -cargo-features = ["edition2024"] -[package] -name = "foo" -version = "0.1.0" -edition = "2024" - -[dependencies] -bar = { version = "0.1.0", optional = true } -"#, - ) - .file("src/lib.rs", "") - .build(); - - snapbox::cmd::Command::cargo_ui() - .masquerade_as_nightly_cargo(&["always_nightly"]) - .current_dir(p.root()) - .arg("check") - .assert() - .code(101) - .stdout_matches(str![""]) - .stderr_matches(file!["stderr.term.svg"]); -} diff --git a/tests/testsuite/lints/rust_2024_compatibility/edition_2024/stderr.term.svg b/tests/testsuite/lints/rust_2024_compatibility/edition_2024/stderr.term.svg deleted file mode 100644 index 3ef7eca92..000000000 --- a/tests/testsuite/lints/rust_2024_compatibility/edition_2024/stderr.term.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - error: unused optional dependency - - --> Cargo.toml:9:1 - - | - - 9 | bar = { version = "0.1.0", optional = true } - - | ^^^ - - | - - - - - - diff --git a/tests/testsuite/lints/rust_2024_compatibility/mod.rs b/tests/testsuite/lints/rust_2024_compatibility/mod.rs deleted file mode 100644 index 7e26a63e2..000000000 --- a/tests/testsuite/lints/rust_2024_compatibility/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -mod edition_2021; -mod edition_2021_warn; -mod edition_2024; -mod warn; diff --git a/tests/testsuite/lints/rust_2024_compatibility/warn/mod.rs b/tests/testsuite/lints/rust_2024_compatibility/warn/mod.rs deleted file mode 100644 index b8b2ee091..000000000 --- a/tests/testsuite/lints/rust_2024_compatibility/warn/mod.rs +++ /dev/null @@ -1,38 +0,0 @@ -use cargo_test_support::prelude::*; -use cargo_test_support::registry::Package; -use cargo_test_support::str; -use cargo_test_support::{file, project}; - -#[cargo_test(nightly, reason = "edition2024 is not stable")] -fn case() { - Package::new("bar", "0.1.0").publish(); - let p = project() - .file( - "Cargo.toml", - r#" -cargo-features = ["edition2024"] -[package] -name = "foo" -version = "0.1.0" -edition = "2024" - -[dependencies] -bar = { version = "0.1.0", optional = true } - -[lints.cargo] -rust-2024-compatibility = "warn" -"#, - ) - .file("src/lib.rs", "") - .build(); - - snapbox::cmd::Command::cargo_ui() - .masquerade_as_nightly_cargo(&["always_nightly"]) - .current_dir(p.root()) - .arg("check") - .arg("--quiet") - .assert() - .success() - .stdout_matches(str![""]) - .stderr_matches(file!["stderr.term.svg"]); -} diff --git a/tests/testsuite/lints/rust_2024_compatibility/warn/stderr.term.svg b/tests/testsuite/lints/rust_2024_compatibility/warn/stderr.term.svg deleted file mode 100644 index 6dac803d6..000000000 --- a/tests/testsuite/lints/rust_2024_compatibility/warn/stderr.term.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - warning: unused optional dependency - - --> Cargo.toml:9:1 - - | - - 9 | bar = { version = "0.1.0", optional = true } - - | --- - - | - - - - - -