Remove some unused #![feature]s (#14738)

Mostly `let_chains` now that it's stable on 2024

changelog: none
This commit is contained in:
Alex Macleod 2025-05-06 14:12:20 +00:00 committed by GitHub
commit cf6bebb343
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 37 additions and 51 deletions

View file

@ -1,4 +1,4 @@
#![feature(rustc_private, array_windows, let_chains)]
#![feature(rustc_private)]
#![warn(
trivial_casts,
trivial_numeric_casts,

View file

@ -1,4 +1,3 @@
#![feature(let_chains)]
#![feature(rustc_private)]
#![warn(
trivial_casts,

View file

@ -1,5 +1,4 @@
#![feature(array_windows)]
#![feature(binary_heap_into_iter_sorted)]
#![feature(box_patterns)]
#![feature(macro_metavar_expr_concat)]
#![feature(f128)]
@ -7,7 +6,6 @@
#![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)]

View file

@ -1,7 +1,7 @@
[package]
name = "clippy_lints_internal"
version = "0.0.1"
edition = "2021"
edition = "2024"
[dependencies]
clippy_config = { path = "../clippy_config" }

View file

@ -1,4 +1,4 @@
#![feature(let_chains, rustc_private)]
#![feature(rustc_private)]
#![allow(
clippy::missing_docs_in_private_items,
clippy::must_use_candidate,

View file

@ -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)]

View file

@ -6,7 +6,6 @@
// positives.
#![feature(iter_collect_into)]
#![feature(let_chains)]
#![warn(
trivial_casts,
trivial_numeric_casts,

View file

@ -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

View file

@ -1,4 +1,4 @@
#![feature(rustc_private, let_chains)]
#![feature(rustc_private)]
#![warn(rust_2018_idioms, unused_lifetimes)]
#![allow(unused_extern_crates)]

View file

@ -1,4 +1,3 @@
#![feature(let_chains)]
#![warn(clippy::bool_to_int_with_if)]
#![allow(unused, dead_code, clippy::unnecessary_operation, clippy::no_effect)]

View file

@ -1,4 +1,3 @@
#![feature(let_chains)]
#![warn(clippy::bool_to_int_with_if)]
#![allow(unused, dead_code, clippy::unnecessary_operation, clippy::no_effect)]

View file

@ -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 | |
@ -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 | |
@ -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 | |
@ -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 | |
@ -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 | |
@ -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 | |
@ -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 {
| ____________^
@ -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 {
| ____________^
@ -107,7 +107,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: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)`
@ -115,7 +115,7 @@ LL | if a { 1 } else { 0 }
= 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))`
@ -123,7 +123,7 @@ LL | let _ = if dbg!(4 > 0) { 1 } else { 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)`

View file

@ -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

View file

@ -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

View file

@ -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()`
@ -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()`

View file

@ -1,5 +1,4 @@
//@aux-build:proc_macros.rs
#![feature(let_chains)]
#![allow(
clippy::blocks_in_conditions,
clippy::if_same_then_else,

View file

@ -1,5 +1,4 @@
//@aux-build:proc_macros.rs
#![feature(let_chains)]
#![allow(
clippy::blocks_in_conditions,
clippy::if_same_then_else,

View file

@ -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
@ -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 | |
@ -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 | |
@ -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;`

View file

@ -1,4 +1,4 @@
#![feature(let_chains, if_let_guard)]
#![feature(if_let_guard)]
#![warn(clippy::redundant_pattern_matching)]
#![allow(
clippy::needless_bool,

View file

@ -1,4 +1,4 @@
#![feature(let_chains, if_let_guard)]
#![feature(if_let_guard)]
#![warn(clippy::redundant_pattern_matching)]
#![allow(
clippy::needless_bool,