Skip to content

Commit c4532c0

Browse files
clippy
1 parent 73e9259 commit c4532c0

6 files changed

+25
-14
lines changed

src/tools/clippy/tests/ui/empty_enum.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: enum with no variants
2-
--> $DIR/empty_enum.rs:5:1
2+
--> $DIR/empty_enum.rs:4:1
33
|
44
LL | enum Empty {}
55
| ^^^^^^^^^^^^^
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error: enum with no variants
2+
--> $DIR/empty_enum_without_never_type.rs:5:1
3+
|
4+
LL | enum Empty {}
5+
| ^^^^^^^^^^^^^
6+
|
7+
= note: `-D clippy::empty-enum` implied by `-D warnings`
8+
= help: consider using the uninhabited type `!` (never type) or a wrapper around it to introduce a type which can't be instantiated
9+
10+
error: aborting due to previous error
11+

src/tools/clippy/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

src/tools/clippy/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

src/tools/clippy/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`

src/tools/clippy/tests/ui/result_map_unit_fn_unfixable.stderr

+6-6
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 closure that returns the unit type `()`
2-
--> $DIR/result_map_unit_fn_unfixable.rs:23:5
2+
--> $DIR/result_map_unit_fn_unfixable.rs:22:5
33
|
44
LL | x.field.map(|value| { do_nothing(value); do_nothing(value) });
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
@@ -9,15 +9,15 @@ LL | x.field.map(|value| { do_nothing(value); do_nothing(value) });
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 closure that returns the unit type `()`
12-
--> $DIR/result_map_unit_fn_unfixable.rs:25:5
12+
--> $DIR/result_map_unit_fn_unfixable.rs:24:5
1313
|
1414
LL | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
1515
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
1616
| |
1717
| help: try this: `if let Ok(value) = x.field { ... }`
1818

1919
error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
20-
--> $DIR/result_map_unit_fn_unfixable.rs:29:5
20+
--> $DIR/result_map_unit_fn_unfixable.rs:28:5
2121
|
2222
LL | x.field.map(|value| {
2323
| _____^
@@ -31,23 +31,23 @@ LL | || });
3131
|
3232

3333
error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
34-
--> $DIR/result_map_unit_fn_unfixable.rs:33:5
34+
--> $DIR/result_map_unit_fn_unfixable.rs:32:5
3535
|
3636
LL | x.field.map(|value| { do_nothing(value); do_nothing(value); });
3737
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
3838
| |
3939
| help: try this: `if let Ok(value) = x.field { ... }`
4040

4141
error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
42-
--> $DIR/result_map_unit_fn_unfixable.rs:37:5
42+
--> $DIR/result_map_unit_fn_unfixable.rs:36:5
4343
|
4444
LL | "12".parse::<i32>().map(diverge);
4545
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
4646
| |
4747
| help: try this: `if let Ok(a) = "12".parse::<i32>() { diverge(a) }`
4848

4949
error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
50-
--> $DIR/result_map_unit_fn_unfixable.rs:43:5
50+
--> $DIR/result_map_unit_fn_unfixable.rs:42:5
5151
|
5252
LL | y.map(do_nothing);
5353
| ^^^^^^^^^^^^^^^^^-

0 commit comments

Comments
 (0)