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