|
1 | | -error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases |
| 1 | +error: use of `Option<Option<T>>` |
2 | 2 | --> tests/ui/option_option.rs:4:10 |
3 | 3 | | |
4 | 4 | LL | const C: Option<Option<i32>> = None; |
5 | 5 | | ^^^^^^^^^^^^^^^^^^^ |
6 | 6 | | |
7 | | -note: the lint level is defined here |
8 | | - --> tests/ui/option_option.rs:1:9 |
9 | | - | |
10 | | -LL | #![deny(clippy::option_option)] |
11 | | - | ^^^^^^^^^^^^^^^^^^^^^ |
| 7 | + = help: consider using `Option<i32>`, or a custom enum if you need to distinguish all 3 cases |
| 8 | + = note: `-D clippy::option-option` implied by `-D warnings` |
| 9 | + = help: to override `-D warnings` add `#[allow(clippy::option_option)]` |
12 | 10 |
|
13 | | -error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases |
| 11 | +error: use of `Option<Option<T>>` |
14 | 12 | --> tests/ui/option_option.rs:6:11 |
15 | 13 | | |
16 | 14 | LL | static S: Option<Option<i32>> = None; |
17 | 15 | | ^^^^^^^^^^^^^^^^^^^ |
| 16 | + | |
| 17 | + = help: consider using `Option<i32>`, or a custom enum if you need to distinguish all 3 cases |
18 | 18 |
|
19 | | -error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases |
| 19 | +error: use of `Option<Option<T>>` |
20 | 20 | --> tests/ui/option_option.rs:9:13 |
21 | 21 | | |
22 | 22 | LL | fn input(_: Option<Option<u8>>) {} |
23 | 23 | | ^^^^^^^^^^^^^^^^^^ |
| 24 | + | |
| 25 | + = help: consider using `Option<u8>`, or a custom enum if you need to distinguish all 3 cases |
24 | 26 |
|
25 | | -error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases |
| 27 | +error: use of `Option<Option<T>>` |
26 | 28 | --> tests/ui/option_option.rs:12:16 |
27 | 29 | | |
28 | 30 | LL | fn output() -> Option<Option<u8>> { |
29 | 31 | | ^^^^^^^^^^^^^^^^^^ |
| 32 | + | |
| 33 | + = help: consider using `Option<u8>`, or a custom enum if you need to distinguish all 3 cases |
30 | 34 |
|
31 | | -error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases |
| 35 | +error: use of `Option<Option<T>>` |
32 | 36 | --> tests/ui/option_option.rs:17:27 |
33 | 37 | | |
34 | 38 | LL | fn output_nested() -> Vec<Option<Option<u8>>> { |
35 | 39 | | ^^^^^^^^^^^^^^^^^^ |
| 40 | + | |
| 41 | + = help: consider using `Option<u8>`, or a custom enum if you need to distinguish all 3 cases |
36 | 42 |
|
37 | | -error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases |
| 43 | +error: use of `Option<Option<T>>` |
38 | 44 | --> tests/ui/option_option.rs:23:30 |
39 | 45 | | |
40 | 46 | LL | fn output_nested_nested() -> Option<Option<Option<u8>>> { |
41 | 47 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 48 | + | |
| 49 | + = help: consider using `Option<Option<u8>>`, or a custom enum if you need to distinguish all 3 cases |
42 | 50 |
|
43 | | -error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases |
| 51 | +error: use of `Option<Option<T>>` |
44 | 52 | --> tests/ui/option_option.rs:29:8 |
45 | 53 | | |
46 | 54 | LL | x: Option<Option<u8>>, |
47 | 55 | | ^^^^^^^^^^^^^^^^^^ |
| 56 | + | |
| 57 | + = help: consider using `Option<u8>`, or a custom enum if you need to distinguish all 3 cases |
48 | 58 |
|
49 | | -error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases |
| 59 | +error: use of `Option<Option<T>>` |
50 | 60 | --> tests/ui/option_option.rs:34:23 |
51 | 61 | | |
52 | 62 | LL | fn struct_fn() -> Option<Option<u8>> { |
53 | 63 | | ^^^^^^^^^^^^^^^^^^ |
| 64 | + | |
| 65 | + = help: consider using `Option<u8>`, or a custom enum if you need to distinguish all 3 cases |
54 | 66 |
|
55 | | -error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases |
| 67 | +error: use of `Option<Option<T>>` |
56 | 68 | --> tests/ui/option_option.rs:41:22 |
57 | 69 | | |
58 | 70 | LL | fn trait_fn() -> Option<Option<u8>>; |
59 | 71 | | ^^^^^^^^^^^^^^^^^^ |
| 72 | + | |
| 73 | + = help: consider using `Option<u8>`, or a custom enum if you need to distinguish all 3 cases |
60 | 74 |
|
61 | | -error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases |
| 75 | +error: use of `Option<Option<T>>` |
62 | 76 | --> tests/ui/option_option.rs:46:11 |
63 | 77 | | |
64 | 78 | LL | Tuple(Option<Option<u8>>), |
65 | 79 | | ^^^^^^^^^^^^^^^^^^ |
| 80 | + | |
| 81 | + = help: consider using `Option<u8>`, or a custom enum if you need to distinguish all 3 cases |
66 | 82 |
|
67 | | -error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases |
| 83 | +error: use of `Option<Option<T>>` |
68 | 84 | --> tests/ui/option_option.rs:48:17 |
69 | 85 | | |
70 | 86 | LL | Struct { x: Option<Option<u8>> }, |
71 | 87 | | ^^^^^^^^^^^^^^^^^^ |
| 88 | + | |
| 89 | + = help: consider using `Option<u8>`, or a custom enum if you need to distinguish all 3 cases |
72 | 90 |
|
73 | | -error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases |
| 91 | +error: use of `Option<Option<T>>` |
74 | 92 | --> tests/ui/option_option.rs:90:14 |
75 | 93 | | |
76 | 94 | LL | foo: Option<Option<Cow<'a, str>>>, |
77 | 95 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 96 | + | |
| 97 | + = help: consider using `Option<Cow<'a, str>>`, or a custom enum if you need to distinguish all 3 cases |
78 | 98 |
|
79 | 99 | error: aborting due to 12 previous errors |
80 | 100 |
|
0 commit comments