Skip to content

Commit f6e8da8

Browse files
committed
Update option_option ui test
1 parent 86b0dd4 commit f6e8da8

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

tests/ui/option_option.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![deny(clippy::option_option)]
2+
13
fn input(_: Option<Option<u8>>) {}
24

35
fn output() -> Option<Option<u8>> {

tests/ui/option_option.stderr

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,59 @@
11
error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
2-
--> $DIR/option_option.rs:1:13
2+
--> $DIR/option_option.rs:3:13
33
|
44
LL | fn input(_: Option<Option<u8>>) {}
55
| ^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `-D clippy::option-option` implied by `-D warnings`
7+
note: the lint level is defined here
8+
--> $DIR/option_option.rs:1:9
9+
|
10+
LL | #![deny(clippy::option_option)]
11+
| ^^^^^^^^^^^^^^^^^^^^^
812

913
error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
10-
--> $DIR/option_option.rs:3:16
14+
--> $DIR/option_option.rs:5:16
1115
|
1216
LL | fn output() -> Option<Option<u8>> {
1317
| ^^^^^^^^^^^^^^^^^^
1418

1519
error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
16-
--> $DIR/option_option.rs:7:27
20+
--> $DIR/option_option.rs:9:27
1721
|
1822
LL | fn output_nested() -> Vec<Option<Option<u8>>> {
1923
| ^^^^^^^^^^^^^^^^^^
2024

2125
error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
22-
--> $DIR/option_option.rs:12:30
26+
--> $DIR/option_option.rs:14:30
2327
|
2428
LL | fn output_nested_nested() -> Option<Option<Option<u8>>> {
2529
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
2630

2731
error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
28-
--> $DIR/option_option.rs:17:8
32+
--> $DIR/option_option.rs:19:8
2933
|
3034
LL | x: Option<Option<u8>>,
3135
| ^^^^^^^^^^^^^^^^^^
3236

3337
error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
34-
--> $DIR/option_option.rs:21:23
38+
--> $DIR/option_option.rs:23:23
3539
|
3640
LL | fn struct_fn() -> Option<Option<u8>> {
3741
| ^^^^^^^^^^^^^^^^^^
3842

3943
error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
40-
--> $DIR/option_option.rs:27:22
44+
--> $DIR/option_option.rs:29:22
4145
|
4246
LL | fn trait_fn() -> Option<Option<u8>>;
4347
| ^^^^^^^^^^^^^^^^^^
4448

4549
error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
46-
--> $DIR/option_option.rs:31:11
50+
--> $DIR/option_option.rs:33:11
4751
|
4852
LL | Tuple(Option<Option<u8>>),
4953
| ^^^^^^^^^^^^^^^^^^
5054

5155
error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
52-
--> $DIR/option_option.rs:32:17
56+
--> $DIR/option_option.rs:34:17
5357
|
5458
LL | Struct { x: Option<Option<u8>> },
5559
| ^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)