Skip to content

Remove some unused #![feature]s #14738

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

Merged
merged 2 commits into from
May 6, 2025
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
2 changes: 1 addition & 1 deletion clippy_config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(rustc_private, array_windows, let_chains)]
#![feature(rustc_private)]
#![warn(
trivial_casts,
trivial_numeric_casts,
Expand Down
1 change: 0 additions & 1 deletion clippy_dev/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(let_chains)]
#![feature(rustc_private)]
#![warn(
trivial_casts,
Expand Down
2 changes: 0 additions & 2 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#![feature(array_windows)]
#![feature(binary_heap_into_iter_sorted)]
#![feature(box_patterns)]
#![feature(macro_metavar_expr_concat)]
#![feature(f128)]
#![feature(f16)]
#![feature(if_let_guard)]
#![feature(iter_intersperse)]
#![feature(iter_partition_in_place)]
#![feature(let_chains)]
#![feature(never_type)]
#![feature(round_char_boundary)]
#![feature(rustc_private)]
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints_internal/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "clippy_lints_internal"
version = "0.0.1"
edition = "2021"
edition = "2024"

[dependencies]
clippy_config = { path = "../clippy_config" }
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints_internal/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(let_chains, rustc_private)]
#![feature(rustc_private)]
#![allow(
clippy::missing_docs_in_private_items,
clippy::must_use_candidate,
Expand Down
3 changes: 0 additions & 3 deletions clippy_utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#![feature(array_chunks)]
#![feature(box_patterns)]
#![feature(if_let_guard)]
#![feature(macro_metavar_expr_concat)]
#![feature(macro_metavar_expr)]
#![feature(let_chains)]
#![feature(never_type)]
#![feature(rustc_private)]
#![feature(assert_matches)]
Expand Down
1 change: 0 additions & 1 deletion lintcheck/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// positives.

#![feature(iter_collect_into)]
#![feature(let_chains)]
#![warn(
trivial_casts,
trivial_numeric_casts,
Expand Down
1 change: 0 additions & 1 deletion src/driver.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![allow(rustc::diagnostic_outside_of_impl)]
#![allow(rustc::untranslatable_diagnostic)]
#![feature(rustc_private)]
#![feature(let_chains)]
// 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
2 changes: 1 addition & 1 deletion tests/compile-test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(rustc_private, let_chains)]
#![feature(rustc_private)]
#![warn(rust_2018_idioms, unused_lifetimes)]
#![allow(unused_extern_crates)]

Expand Down
1 change: 0 additions & 1 deletion tests/ui/bool_to_int_with_if.fixed
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(let_chains)]
#![warn(clippy::bool_to_int_with_if)]
#![allow(unused, dead_code, clippy::unnecessary_operation, clippy::no_effect)]

Expand Down
1 change: 0 additions & 1 deletion tests/ui/bool_to_int_with_if.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(let_chains)]
#![warn(clippy::bool_to_int_with_if)]
#![allow(unused, dead_code, clippy::unnecessary_operation, clippy::no_effect)]

Expand Down
22 changes: 11 additions & 11 deletions tests/ui/bool_to_int_with_if.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: boolean to int conversion using if
--> tests/ui/bool_to_int_with_if.rs:14:5
--> tests/ui/bool_to_int_with_if.rs:13:5
|
LL | / if a {
LL | |
Expand All @@ -14,7 +14,7 @@ LL | | };
= help: to override `-D warnings` add `#[allow(clippy::bool_to_int_with_if)]`

error: boolean to int conversion using if
--> tests/ui/bool_to_int_with_if.rs:20:5
--> tests/ui/bool_to_int_with_if.rs:19:5
|
LL | / if a {
LL | |
Expand All @@ -27,7 +27,7 @@ LL | | };
= note: `!a as i32` or `(!a).into()` can also be valid options

error: boolean to int conversion using if
--> tests/ui/bool_to_int_with_if.rs:26:5
--> tests/ui/bool_to_int_with_if.rs:25:5
|
LL | / if !a {
LL | |
Expand All @@ -40,7 +40,7 @@ LL | | };
= note: `!a as i32` or `(!a).into()` can also be valid options

error: boolean to int conversion using if
--> tests/ui/bool_to_int_with_if.rs:32:5
--> tests/ui/bool_to_int_with_if.rs:31:5
|
LL | / if a || b {
LL | |
Expand All @@ -53,7 +53,7 @@ LL | | };
= note: `(a || b) as i32` or `(a || b).into()` can also be valid options

error: boolean to int conversion using if
--> tests/ui/bool_to_int_with_if.rs:38:5
--> tests/ui/bool_to_int_with_if.rs:37:5
|
LL | / if cond(a, b) {
LL | |
Expand All @@ -66,7 +66,7 @@ LL | | };
= note: `cond(a, b) as i32` or `cond(a, b).into()` can also be valid options

error: boolean to int conversion using if
--> tests/ui/bool_to_int_with_if.rs:44:5
--> tests/ui/bool_to_int_with_if.rs:43:5
|
LL | / if x + y < 4 {
LL | |
Expand All @@ -79,7 +79,7 @@ LL | | };
= note: `(x + y < 4) as i32` or `(x + y < 4).into()` can also be valid options

error: boolean to int conversion using if
--> tests/ui/bool_to_int_with_if.rs:54:12
--> tests/ui/bool_to_int_with_if.rs:53:12
|
LL | } else if b {
| ____________^
Expand All @@ -93,7 +93,7 @@ LL | | };
= note: `b as i32` or `b.into()` can also be valid options

error: boolean to int conversion using if
--> tests/ui/bool_to_int_with_if.rs:64:12
--> tests/ui/bool_to_int_with_if.rs:63:12
|
LL | } else if b {
| ____________^
Expand All @@ -107,23 +107,23 @@ LL | | };
= note: `!b as i32` or `(!b).into()` can also be valid options

error: boolean to int conversion using if
--> tests/ui/bool_to_int_with_if.rs:130:5
--> tests/ui/bool_to_int_with_if.rs:129:5
|
LL | if a { 1 } else { 0 }
| ^^^^^^^^^^^^^^^^^^^^^ help: replace with from: `u8::from(a)`
|
= note: `a as u8` or `a.into()` can also be valid options

error: boolean to int conversion using if
--> tests/ui/bool_to_int_with_if.rs:174:13
--> tests/ui/bool_to_int_with_if.rs:173:13
|
LL | let _ = if dbg!(4 > 0) { 1 } else { 0 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with from: `i32::from(dbg!(4 > 0))`
|
= note: `dbg!(4 > 0) as i32` or `dbg!(4 > 0).into()` can also be valid options

error: boolean to int conversion using if
--> tests/ui/bool_to_int_with_if.rs:177:18
--> tests/ui/bool_to_int_with_if.rs:176:18
|
LL | let _ = dbg!(if 4 > 0 { 1 } else { 0 });
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with from: `i32::from(4 > 0)`
Expand Down
1 change: 0 additions & 1 deletion tests/ui/comparison_to_empty.fixed
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![warn(clippy::comparison_to_empty)]
#![allow(clippy::borrow_deref_ref, clippy::needless_if, clippy::useless_vec)]
#![feature(let_chains)]

fn main() {
// Disallow comparisons to empty
Expand Down
1 change: 0 additions & 1 deletion tests/ui/comparison_to_empty.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![warn(clippy::comparison_to_empty)]
#![allow(clippy::borrow_deref_ref, clippy::needless_if, clippy::useless_vec)]
#![feature(let_chains)]

fn main() {
// Disallow comparisons to empty
Expand Down
26 changes: 13 additions & 13 deletions tests/ui/comparison_to_empty.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: comparison to empty slice
--> tests/ui/comparison_to_empty.rs:8:13
--> tests/ui/comparison_to_empty.rs:7:13
|
LL | let _ = s == "";
| ^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()`
Expand All @@ -8,73 +8,73 @@ LL | let _ = s == "";
= help: to override `-D warnings` add `#[allow(clippy::comparison_to_empty)]`

error: comparison to empty slice
--> tests/ui/comparison_to_empty.rs:10:13
--> tests/ui/comparison_to_empty.rs:9:13
|
LL | let _ = s != "";
| ^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.is_empty()`

error: comparison to empty slice
--> tests/ui/comparison_to_empty.rs:14:13
--> tests/ui/comparison_to_empty.rs:13:13
|
LL | let _ = v == [];
| ^^^^^^^ help: using `is_empty` is clearer and more explicit: `v.is_empty()`

error: comparison to empty slice
--> tests/ui/comparison_to_empty.rs:16:13
--> tests/ui/comparison_to_empty.rs:15:13
|
LL | let _ = v != [];
| ^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()`

error: comparison to empty slice using `if let`
--> tests/ui/comparison_to_empty.rs:18:8
--> tests/ui/comparison_to_empty.rs:17:8
|
LL | if let [] = &*v {}
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `(*v).is_empty()`

error: comparison to empty slice using `if let`
--> tests/ui/comparison_to_empty.rs:21:8
--> tests/ui/comparison_to_empty.rs:20:8
|
LL | if let [] = s {}
| ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()`

error: comparison to empty slice using `if let`
--> tests/ui/comparison_to_empty.rs:23:8
--> tests/ui/comparison_to_empty.rs:22:8
|
LL | if let [] = &*s {}
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()`

error: comparison to empty slice using `if let`
--> tests/ui/comparison_to_empty.rs:25:8
--> tests/ui/comparison_to_empty.rs:24:8
|
LL | if let [] = &*s
| ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()`

error: comparison to empty slice
--> tests/ui/comparison_to_empty.rs:27:12
--> tests/ui/comparison_to_empty.rs:26:12
|
LL | && s == []
| ^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()`

error: comparison to empty slice
--> tests/ui/comparison_to_empty.rs:48:13
--> tests/ui/comparison_to_empty.rs:47:13
|
LL | let _ = s.eq("");
| ^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()`

error: comparison to empty slice
--> tests/ui/comparison_to_empty.rs:50:13
--> tests/ui/comparison_to_empty.rs:49:13
|
LL | let _ = s.ne("");
| ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.is_empty()`

error: comparison to empty slice
--> tests/ui/comparison_to_empty.rs:53:13
--> tests/ui/comparison_to_empty.rs:52:13
|
LL | let _ = v.eq(&[]);
| ^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `v.is_empty()`

error: comparison to empty slice
--> tests/ui/comparison_to_empty.rs:55:13
--> tests/ui/comparison_to_empty.rs:54:13
|
LL | let _ = v.ne(&[]);
| ^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()`
Expand Down
1 change: 0 additions & 1 deletion tests/ui/needless_if.fixed
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@aux-build:proc_macros.rs
#![feature(let_chains)]
#![allow(
clippy::blocks_in_conditions,
clippy::if_same_then_else,
Expand Down
1 change: 0 additions & 1 deletion tests/ui/needless_if.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@aux-build:proc_macros.rs
#![feature(let_chains)]
#![allow(
clippy::blocks_in_conditions,
clippy::if_same_then_else,
Expand Down
14 changes: 7 additions & 7 deletions tests/ui/needless_if.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: this `if` branch is empty
--> tests/ui/needless_if.rs:27:5
--> tests/ui/needless_if.rs:26:5
|
LL | if (true) {}
| ^^^^^^^^^^^^ help: you can remove it
Expand All @@ -8,13 +8,13 @@ LL | if (true) {}
= help: to override `-D warnings` add `#[allow(clippy::needless_if)]`

error: this `if` branch is empty
--> tests/ui/needless_if.rs:30:5
--> tests/ui/needless_if.rs:29:5
|
LL | if maybe_side_effect() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `maybe_side_effect();`

error: this `if` branch is empty
--> tests/ui/needless_if.rs:36:5
--> tests/ui/needless_if.rs:35:5
|
LL | / if {
LL | |
Expand All @@ -31,7 +31,7 @@ LL + });
|

error: this `if` branch is empty
--> tests/ui/needless_if.rs:51:5
--> tests/ui/needless_if.rs:50:5
|
LL | / if {
LL | |
Expand All @@ -57,19 +57,19 @@ LL + } && true);
|

error: this `if` branch is empty
--> tests/ui/needless_if.rs:96:5
--> tests/ui/needless_if.rs:95:5
|
LL | if { maybe_side_effect() } {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() });`

error: this `if` branch is empty
--> tests/ui/needless_if.rs:99:5
--> tests/ui/needless_if.rs:98:5
|
LL | if { maybe_side_effect() } && true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `({ maybe_side_effect() } && true);`

error: this `if` branch is empty
--> tests/ui/needless_if.rs:104:5
--> tests/ui/needless_if.rs:103:5
|
LL | if true {}
| ^^^^^^^^^^ help: you can remove it: `true;`
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/redundant_pattern_matching_option.fixed
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(let_chains, if_let_guard)]
#![feature(if_let_guard)]
#![warn(clippy::redundant_pattern_matching)]
#![allow(
clippy::needless_bool,
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/redundant_pattern_matching_option.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(let_chains, if_let_guard)]
#![feature(if_let_guard)]
#![warn(clippy::redundant_pattern_matching)]
#![allow(
clippy::needless_bool,
Expand Down