Skip to content

Commit 3c308b8

Browse files
committed
Remove never_type feature
Stablized in rust-lang/rust#65355
1 parent d183bda commit 3c308b8

13 files changed

+34
-41
lines changed

clippy_lints/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#![feature(box_syntax)]
44
#![feature(box_patterns)]
5-
#![feature(never_type)]
65
#![feature(rustc_private)]
76
#![feature(slice_patterns)]
87
#![feature(stmt_expr_attributes)]

tests/ui/diverging_sub_expression.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(never_type)]
21
#![warn(clippy::diverging_sub_expression)]
32
#![allow(clippy::match_same_arms, clippy::logic_bug)]
43

tests/ui/diverging_sub_expression.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
error: sub-expression diverges
2-
--> $DIR/diverging_sub_expression.rs:21:10
2+
--> $DIR/diverging_sub_expression.rs:20:10
33
|
44
LL | b || diverge();
55
| ^^^^^^^^^
66
|
77
= note: `-D clippy::diverging-sub-expression` implied by `-D warnings`
88

99
error: sub-expression diverges
10-
--> $DIR/diverging_sub_expression.rs:22:10
10+
--> $DIR/diverging_sub_expression.rs:21:10
1111
|
1212
LL | b || A.foo();
1313
| ^^^^^^^
1414

1515
error: sub-expression diverges
16-
--> $DIR/diverging_sub_expression.rs:31:26
16+
--> $DIR/diverging_sub_expression.rs:30:26
1717
|
1818
LL | 6 => true || return,
1919
| ^^^^^^
2020

2121
error: sub-expression diverges
22-
--> $DIR/diverging_sub_expression.rs:32:26
22+
--> $DIR/diverging_sub_expression.rs:31:26
2323
|
2424
LL | 7 => true || continue,
2525
| ^^^^^^^^
2626

2727
error: sub-expression diverges
28-
--> $DIR/diverging_sub_expression.rs:35:26
28+
--> $DIR/diverging_sub_expression.rs:34:26
2929
|
3030
LL | 3 => true || diverge(),
3131
| ^^^^^^^^^
3232

3333
error: sub-expression diverges
34-
--> $DIR/diverging_sub_expression.rs:40:26
34+
--> $DIR/diverging_sub_expression.rs:39:26
3535
|
3636
LL | _ => true || break,
3737
| ^^^^^

tests/ui/infallible_destructuring_match.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
#![feature(exhaustive_patterns, never_type)]
2+
#![feature(exhaustive_patterns)]
33
#![allow(dead_code, unreachable_code, unused_variables)]
44
#![allow(clippy::let_and_return)]
55

tests/ui/infallible_destructuring_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
#![feature(exhaustive_patterns, never_type)]
2+
#![feature(exhaustive_patterns)]
33
#![allow(dead_code, unreachable_code, unused_variables)]
44
#![allow(clippy::let_and_return)]
55

tests/ui/must_use_candidates.fixed

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// run-rustfix
2-
#![feature(never_type)]
32
#![allow(unused_mut)]
43
#![warn(clippy::must_use_candidate)]
54
use std::rc::Rc;

tests/ui/must_use_candidates.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// run-rustfix
2-
#![feature(never_type)]
32
#![allow(unused_mut)]
43
#![warn(clippy::must_use_candidate)]
54
use std::rc::Rc;

tests/ui/must_use_candidates.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
error: this function could have a `#[must_use]` attribute
2-
--> $DIR/must_use_candidates.rs:12:1
2+
--> $DIR/must_use_candidates.rs:11:1
33
|
44
LL | pub fn pure(i: u8) -> u8 {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn pure(i: u8) -> u8`
66
|
77
= note: `-D clippy::must-use-candidate` implied by `-D warnings`
88

99
error: this method could have a `#[must_use]` attribute
10-
--> $DIR/must_use_candidates.rs:17:5
10+
--> $DIR/must_use_candidates.rs:16:5
1111
|
1212
LL | pub fn inherent_pure(&self) -> u8 {
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn inherent_pure(&self) -> u8`
1414

1515
error: this function could have a `#[must_use]` attribute
16-
--> $DIR/must_use_candidates.rs:48:1
16+
--> $DIR/must_use_candidates.rs:47:1
1717
|
1818
LL | pub fn with_marker(_d: std::marker::PhantomData<&mut u32>) -> bool {
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn with_marker(_d: std::marker::PhantomData<&mut u32>) -> bool`
2020

2121
error: this function could have a `#[must_use]` attribute
22-
--> $DIR/must_use_candidates.rs:60:1
22+
--> $DIR/must_use_candidates.rs:59:1
2323
|
2424
LL | pub fn rcd(_x: Rc<u32>) -> bool {
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn rcd(_x: Rc<u32>) -> bool`
2626

2727
error: this function could have a `#[must_use]` attribute
28-
--> $DIR/must_use_candidates.rs:68:1
28+
--> $DIR/must_use_candidates.rs:67:1
2929
|
3030
LL | pub fn arcd(_x: Arc<u32>) -> bool {
3131
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn arcd(_x: Arc<u32>) -> bool`

tests/ui/result_map_unit_fn_fixable.fixed

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-rustfix
22

3-
#![feature(never_type)]
43
#![warn(clippy::result_map_unit_fn)]
54
#![allow(unused)]
65

tests/ui/result_map_unit_fn_fixable.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-rustfix
22

3-
#![feature(never_type)]
43
#![warn(clippy::result_map_unit_fn)]
54
#![allow(unused)]
65

tests/ui/result_map_unit_fn_fixable.stderr

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: called `map(f)` on an Result value where `f` is a unit function
2-
--> $DIR/result_map_unit_fn_fixable.rs:36:5
2+
--> $DIR/result_map_unit_fn_fixable.rs:35:5
33
|
44
LL | x.field.map(do_nothing);
55
| ^^^^^^^^^^^^^^^^^^^^^^^-
@@ -9,127 +9,127 @@ LL | x.field.map(do_nothing);
99
= note: `-D clippy::result-map-unit-fn` implied by `-D warnings`
1010

1111
error: called `map(f)` on an Result value where `f` is a unit function
12-
--> $DIR/result_map_unit_fn_fixable.rs:38:5
12+
--> $DIR/result_map_unit_fn_fixable.rs:37:5
1313
|
1414
LL | x.field.map(do_nothing);
1515
| ^^^^^^^^^^^^^^^^^^^^^^^-
1616
| |
1717
| help: try this: `if let Ok(x_field) = x.field { do_nothing(x_field) }`
1818

1919
error: called `map(f)` on an Result value where `f` is a unit function
20-
--> $DIR/result_map_unit_fn_fixable.rs:40:5
20+
--> $DIR/result_map_unit_fn_fixable.rs:39:5
2121
|
2222
LL | x.field.map(diverge);
2323
| ^^^^^^^^^^^^^^^^^^^^-
2424
| |
2525
| help: try this: `if let Ok(x_field) = x.field { diverge(x_field) }`
2626

2727
error: called `map(f)` on an Result value where `f` is a unit closure
28-
--> $DIR/result_map_unit_fn_fixable.rs:46:5
28+
--> $DIR/result_map_unit_fn_fixable.rs:45:5
2929
|
3030
LL | x.field.map(|value| x.do_result_nothing(value + captured));
3131
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
3232
| |
3333
| help: try this: `if let Ok(value) = x.field { x.do_result_nothing(value + captured) }`
3434

3535
error: called `map(f)` on an Result value where `f` is a unit closure
36-
--> $DIR/result_map_unit_fn_fixable.rs:48:5
36+
--> $DIR/result_map_unit_fn_fixable.rs:47:5
3737
|
3838
LL | x.field.map(|value| { x.do_result_plus_one(value + captured); });
3939
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
4040
| |
4141
| help: try this: `if let Ok(value) = x.field { x.do_result_plus_one(value + captured); }`
4242

4343
error: called `map(f)` on an Result value where `f` is a unit closure
44-
--> $DIR/result_map_unit_fn_fixable.rs:51:5
44+
--> $DIR/result_map_unit_fn_fixable.rs:50:5
4545
|
4646
LL | x.field.map(|value| do_nothing(value + captured));
4747
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
4848
| |
4949
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
5050

5151
error: called `map(f)` on an Result value where `f` is a unit closure
52-
--> $DIR/result_map_unit_fn_fixable.rs:53:5
52+
--> $DIR/result_map_unit_fn_fixable.rs:52:5
5353
|
5454
LL | x.field.map(|value| { do_nothing(value + captured) });
5555
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
5656
| |
5757
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
5858

5959
error: called `map(f)` on an Result value where `f` is a unit closure
60-
--> $DIR/result_map_unit_fn_fixable.rs:55:5
60+
--> $DIR/result_map_unit_fn_fixable.rs:54:5
6161
|
6262
LL | x.field.map(|value| { do_nothing(value + captured); });
6363
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
6464
| |
6565
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
6666

6767
error: called `map(f)` on an Result value where `f` is a unit closure
68-
--> $DIR/result_map_unit_fn_fixable.rs:57:5
68+
--> $DIR/result_map_unit_fn_fixable.rs:56:5
6969
|
7070
LL | x.field.map(|value| { { do_nothing(value + captured); } });
7171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
7272
| |
7373
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
7474

7575
error: called `map(f)` on an Result value where `f` is a unit closure
76-
--> $DIR/result_map_unit_fn_fixable.rs:60:5
76+
--> $DIR/result_map_unit_fn_fixable.rs:59:5
7777
|
7878
LL | x.field.map(|value| diverge(value + captured));
7979
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
8080
| |
8181
| help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
8282

8383
error: called `map(f)` on an Result value where `f` is a unit closure
84-
--> $DIR/result_map_unit_fn_fixable.rs:62:5
84+
--> $DIR/result_map_unit_fn_fixable.rs:61:5
8585
|
8686
LL | x.field.map(|value| { diverge(value + captured) });
8787
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
8888
| |
8989
| help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
9090

9191
error: called `map(f)` on an Result value where `f` is a unit closure
92-
--> $DIR/result_map_unit_fn_fixable.rs:64:5
92+
--> $DIR/result_map_unit_fn_fixable.rs:63:5
9393
|
9494
LL | x.field.map(|value| { diverge(value + captured); });
9595
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
9696
| |
9797
| help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
9898

9999
error: called `map(f)` on an Result value where `f` is a unit closure
100-
--> $DIR/result_map_unit_fn_fixable.rs:66:5
100+
--> $DIR/result_map_unit_fn_fixable.rs:65:5
101101
|
102102
LL | x.field.map(|value| { { diverge(value + captured); } });
103103
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
104104
| |
105105
| help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
106106

107107
error: called `map(f)` on an Result value where `f` is a unit closure
108-
--> $DIR/result_map_unit_fn_fixable.rs:71:5
108+
--> $DIR/result_map_unit_fn_fixable.rs:70:5
109109
|
110110
LL | x.field.map(|value| { let y = plus_one(value + captured); });
111111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
112112
| |
113113
| help: try this: `if let Ok(value) = x.field { let y = plus_one(value + captured); }`
114114

115115
error: called `map(f)` on an Result value where `f` is a unit closure
116-
--> $DIR/result_map_unit_fn_fixable.rs:73:5
116+
--> $DIR/result_map_unit_fn_fixable.rs:72:5
117117
|
118118
LL | x.field.map(|value| { plus_one(value + captured); });
119119
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
120120
| |
121121
| help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
122122

123123
error: called `map(f)` on an Result value where `f` is a unit closure
124-
--> $DIR/result_map_unit_fn_fixable.rs:75:5
124+
--> $DIR/result_map_unit_fn_fixable.rs:74:5
125125
|
126126
LL | x.field.map(|value| { { plus_one(value + captured); } });
127127
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
128128
| |
129129
| help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
130130

131131
error: called `map(f)` on an Result value where `f` is a unit closure
132-
--> $DIR/result_map_unit_fn_fixable.rs:78:5
132+
--> $DIR/result_map_unit_fn_fixable.rs:77:5
133133
|
134134
LL | x.field.map(|ref value| { do_nothing(value + captured) });
135135
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-

tests/ui/result_map_unit_fn_unfixable.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(never_type)]
21
#![warn(clippy::result_map_unit_fn)]
32
#![allow(unused)]
43

tests/ui/result_map_unit_fn_unfixable.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
error[E0425]: cannot find value `x` in this scope
2-
--> $DIR/result_map_unit_fn_unfixable.rs:17:5
2+
--> $DIR/result_map_unit_fn_unfixable.rs:16:5
33
|
44
LL | x.field.map(|value| { do_nothing(value); do_nothing(value) });
55
| ^ not found in this scope
66

77
error[E0425]: cannot find value `x` in this scope
8-
--> $DIR/result_map_unit_fn_unfixable.rs:19:5
8+
--> $DIR/result_map_unit_fn_unfixable.rs:18:5
99
|
1010
LL | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
1111
| ^ not found in this scope
1212

1313
error[E0425]: cannot find value `x` in this scope
14-
--> $DIR/result_map_unit_fn_unfixable.rs:23:5
14+
--> $DIR/result_map_unit_fn_unfixable.rs:22:5
1515
|
1616
LL | x.field.map(|value| {
1717
| ^ not found in this scope
1818

1919
error[E0425]: cannot find value `x` in this scope
20-
--> $DIR/result_map_unit_fn_unfixable.rs:27:5
20+
--> $DIR/result_map_unit_fn_unfixable.rs:26:5
2121
|
2222
LL | x.field.map(|value| { do_nothing(value); do_nothing(value); });
2323
| ^ not found in this scope

0 commit comments

Comments
 (0)