Skip to content

Commit cf6bebb

Browse files
authored
Remove some unused #![feature]s (#14738)
Mostly `let_chains` now that it's stable on 2024 changelog: none
2 parents 7fdded3 + 737d3b3 commit cf6bebb

20 files changed

+37
-51
lines changed

clippy_config/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(rustc_private, array_windows, let_chains)]
1+
#![feature(rustc_private)]
22
#![warn(
33
trivial_casts,
44
trivial_numeric_casts,

clippy_dev/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(let_chains)]
21
#![feature(rustc_private)]
32
#![warn(
43
trivial_casts,

clippy_lints/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
#![feature(array_windows)]
2-
#![feature(binary_heap_into_iter_sorted)]
32
#![feature(box_patterns)]
43
#![feature(macro_metavar_expr_concat)]
54
#![feature(f128)]
65
#![feature(f16)]
76
#![feature(if_let_guard)]
87
#![feature(iter_intersperse)]
98
#![feature(iter_partition_in_place)]
10-
#![feature(let_chains)]
119
#![feature(never_type)]
1210
#![feature(round_char_boundary)]
1311
#![feature(rustc_private)]

clippy_lints_internal/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_lints_internal"
33
version = "0.0.1"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77
clippy_config = { path = "../clippy_config" }

clippy_lints_internal/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(let_chains, rustc_private)]
1+
#![feature(rustc_private)]
22
#![allow(
33
clippy::missing_docs_in_private_items,
44
clippy::must_use_candidate,

clippy_utils/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
#![feature(array_chunks)]
21
#![feature(box_patterns)]
32
#![feature(if_let_guard)]
4-
#![feature(macro_metavar_expr_concat)]
53
#![feature(macro_metavar_expr)]
6-
#![feature(let_chains)]
74
#![feature(never_type)]
85
#![feature(rustc_private)]
96
#![feature(assert_matches)]

lintcheck/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// positives.
77

88
#![feature(iter_collect_into)]
9-
#![feature(let_chains)]
109
#![warn(
1110
trivial_casts,
1211
trivial_numeric_casts,

src/driver.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![allow(rustc::diagnostic_outside_of_impl)]
22
#![allow(rustc::untranslatable_diagnostic)]
33
#![feature(rustc_private)]
4-
#![feature(let_chains)]
54
// warn on lints, that are included in `rust-lang/rust`s bootstrap
65
#![warn(rust_2018_idioms, unused_lifetimes)]
76
// warn on rustc internal lints

tests/compile-test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(rustc_private, let_chains)]
1+
#![feature(rustc_private)]
22
#![warn(rust_2018_idioms, unused_lifetimes)]
33
#![allow(unused_extern_crates)]
44

tests/ui/bool_to_int_with_if.fixed

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(let_chains)]
21
#![warn(clippy::bool_to_int_with_if)]
32
#![allow(unused, dead_code, clippy::unnecessary_operation, clippy::no_effect)]
43

tests/ui/bool_to_int_with_if.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(let_chains)]
21
#![warn(clippy::bool_to_int_with_if)]
32
#![allow(unused, dead_code, clippy::unnecessary_operation, clippy::no_effect)]
43

tests/ui/bool_to_int_with_if.stderr

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: boolean to int conversion using if
2-
--> tests/ui/bool_to_int_with_if.rs:14:5
2+
--> tests/ui/bool_to_int_with_if.rs:13:5
33
|
44
LL | / if a {
55
LL | |
@@ -14,7 +14,7 @@ LL | | };
1414
= help: to override `-D warnings` add `#[allow(clippy::bool_to_int_with_if)]`
1515

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

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

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

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

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

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

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

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

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

125125
error: boolean to int conversion using if
126-
--> tests/ui/bool_to_int_with_if.rs:177:18
126+
--> tests/ui/bool_to_int_with_if.rs:176:18
127127
|
128128
LL | let _ = dbg!(if 4 > 0 { 1 } else { 0 });
129129
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with from: `i32::from(4 > 0)`

tests/ui/comparison_to_empty.fixed

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![warn(clippy::comparison_to_empty)]
22
#![allow(clippy::borrow_deref_ref, clippy::needless_if, clippy::useless_vec)]
3-
#![feature(let_chains)]
43

54
fn main() {
65
// Disallow comparisons to empty

tests/ui/comparison_to_empty.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![warn(clippy::comparison_to_empty)]
22
#![allow(clippy::borrow_deref_ref, clippy::needless_if, clippy::useless_vec)]
3-
#![feature(let_chains)]
43

54
fn main() {
65
// Disallow comparisons to empty

tests/ui/comparison_to_empty.stderr

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: comparison to empty slice
2-
--> tests/ui/comparison_to_empty.rs:8:13
2+
--> tests/ui/comparison_to_empty.rs:7:13
33
|
44
LL | let _ = s == "";
55
| ^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()`
@@ -8,73 +8,73 @@ LL | let _ = s == "";
88
= help: to override `-D warnings` add `#[allow(clippy::comparison_to_empty)]`
99

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

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

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

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

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

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

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

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

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

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

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

7676
error: comparison to empty slice
77-
--> tests/ui/comparison_to_empty.rs:55:13
77+
--> tests/ui/comparison_to_empty.rs:54:13
7878
|
7979
LL | let _ = v.ne(&[]);
8080
| ^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()`

tests/ui/needless_if.fixed

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@aux-build:proc_macros.rs
2-
#![feature(let_chains)]
32
#![allow(
43
clippy::blocks_in_conditions,
54
clippy::if_same_then_else,

tests/ui/needless_if.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@aux-build:proc_macros.rs
2-
#![feature(let_chains)]
32
#![allow(
43
clippy::blocks_in_conditions,
54
clippy::if_same_then_else,

tests/ui/needless_if.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: this `if` branch is empty
2-
--> tests/ui/needless_if.rs:27:5
2+
--> tests/ui/needless_if.rs:26:5
33
|
44
LL | if (true) {}
55
| ^^^^^^^^^^^^ help: you can remove it
@@ -8,13 +8,13 @@ LL | if (true) {}
88
= help: to override `-D warnings` add `#[allow(clippy::needless_if)]`
99

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

1616
error: this `if` branch is empty
17-
--> tests/ui/needless_if.rs:36:5
17+
--> tests/ui/needless_if.rs:35:5
1818
|
1919
LL | / if {
2020
LL | |
@@ -31,7 +31,7 @@ LL + });
3131
|
3232

3333
error: this `if` branch is empty
34-
--> tests/ui/needless_if.rs:51:5
34+
--> tests/ui/needless_if.rs:50:5
3535
|
3636
LL | / if {
3737
LL | |
@@ -57,19 +57,19 @@ LL + } && true);
5757
|
5858

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

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

7171
error: this `if` branch is empty
72-
--> tests/ui/needless_if.rs:104:5
72+
--> tests/ui/needless_if.rs:103:5
7373
|
7474
LL | if true {}
7575
| ^^^^^^^^^^ help: you can remove it: `true;`

tests/ui/redundant_pattern_matching_option.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(let_chains, if_let_guard)]
1+
#![feature(if_let_guard)]
22
#![warn(clippy::redundant_pattern_matching)]
33
#![allow(
44
clippy::needless_bool,

tests/ui/redundant_pattern_matching_option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(let_chains, if_let_guard)]
1+
#![feature(if_let_guard)]
22
#![warn(clippy::redundant_pattern_matching)]
33
#![allow(
44
clippy::needless_bool,

0 commit comments

Comments
 (0)