11error: 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:4:13
2+ --> $DIR/option_option.rs:4:10
33 |
4- LL | fn input(_ : Option<Option<u8>>) {}
5- | ^^^^^^^^^^^^^^^^^^
4+ LL | const C : Option<Option<i32>> = None;
5+ | ^ ^^^^^^^^^^^^^^^^^^
66 |
77note: the lint level is defined here
88 --> $DIR/option_option.rs:1:9
@@ -11,58 +11,70 @@ LL | #![deny(clippy::option_option)]
1111 | ^^^^^^^^^^^^^^^^^^^^^
1212
1313error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
14- --> $DIR/option_option.rs:6:16
14+ --> $DIR/option_option.rs:5:11
15+ |
16+ LL | static S: Option<Option<i32>> = None;
17+ | ^^^^^^^^^^^^^^^^^^^
18+
19+ error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
20+ --> $DIR/option_option.rs:7:13
21+ |
22+ LL | fn input(_: Option<Option<u8>>) {}
23+ | ^^^^^^^^^^^^^^^^^^
24+
25+ error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
26+ --> $DIR/option_option.rs:9:16
1527 |
1628LL | fn output() -> Option<Option<u8>> {
1729 | ^^^^^^^^^^^^^^^^^^
1830
1931error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
20- --> $DIR/option_option.rs:10 :27
32+ --> $DIR/option_option.rs:13 :27
2133 |
2234LL | fn output_nested() -> Vec<Option<Option<u8>>> {
2335 | ^^^^^^^^^^^^^^^^^^
2436
2537error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
26- --> $DIR/option_option.rs:15 :30
38+ --> $DIR/option_option.rs:18 :30
2739 |
2840LL | fn output_nested_nested() -> Option<Option<Option<u8>>> {
2941 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
3042
3143error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
32- --> $DIR/option_option.rs:20 :8
44+ --> $DIR/option_option.rs:23 :8
3345 |
3446LL | x: Option<Option<u8>>,
3547 | ^^^^^^^^^^^^^^^^^^
3648
3749error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
38- --> $DIR/option_option.rs:24 :23
50+ --> $DIR/option_option.rs:27 :23
3951 |
4052LL | fn struct_fn() -> Option<Option<u8>> {
4153 | ^^^^^^^^^^^^^^^^^^
4254
4355error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
44- --> $DIR/option_option.rs:30 :22
56+ --> $DIR/option_option.rs:33 :22
4557 |
4658LL | fn trait_fn() -> Option<Option<u8>>;
4759 | ^^^^^^^^^^^^^^^^^^
4860
4961error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
50- --> $DIR/option_option.rs:34 :11
62+ --> $DIR/option_option.rs:37 :11
5163 |
5264LL | Tuple(Option<Option<u8>>),
5365 | ^^^^^^^^^^^^^^^^^^
5466
5567error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
56- --> $DIR/option_option.rs:35 :17
68+ --> $DIR/option_option.rs:38 :17
5769 |
5870LL | Struct { x: Option<Option<u8>> },
5971 | ^^^^^^^^^^^^^^^^^^
6072
6173error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
62- --> $DIR/option_option.rs:76 :14
74+ --> $DIR/option_option.rs:79 :14
6375 |
6476LL | foo: Option<Option<Cow<'a, str>>>,
6577 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6678
67- error: aborting due to 10 previous errors
79+ error: aborting due to 12 previous errors
6880
0 commit comments