fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.1 KiB80 linesraw
1error: 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:10
3   |
4LL | const C: Option<Option<i32>> = None;
5   |          ^^^^^^^^^^^^^^^^^^^
6   |
7note: the lint level is defined here
8  --> $DIR/option_option.rs:1:9
9   |
10LL | #![deny(clippy::option_option)]
11   |         ^^^^^^^^^^^^^^^^^^^^^
12
13error: 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:11
15   |
16LL | static S: Option<Option<i32>> = None;
17   |           ^^^^^^^^^^^^^^^^^^^
18
19error: 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:9:13
21   |
22LL | fn input(_: Option<Option<u8>>) {}
23   |             ^^^^^^^^^^^^^^^^^^
24
25error: 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:12:16
27   |
28LL | fn output() -> Option<Option<u8>> {
29   |                ^^^^^^^^^^^^^^^^^^
30
31error: 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:17:27
33   |
34LL | fn output_nested() -> Vec<Option<Option<u8>>> {
35   |                           ^^^^^^^^^^^^^^^^^^
36
37error: 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:23:30
39   |
40LL | fn output_nested_nested() -> Option<Option<Option<u8>>> {
41   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^
42
43error: 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:29:8
45   |
46LL |     x: Option<Option<u8>>,
47   |        ^^^^^^^^^^^^^^^^^^
48
49error: 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:23
51   |
52LL |     fn struct_fn() -> Option<Option<u8>> {
53   |                       ^^^^^^^^^^^^^^^^^^
54
55error: 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:41:22
57   |
58LL |     fn trait_fn() -> Option<Option<u8>>;
59   |                      ^^^^^^^^^^^^^^^^^^
60
61error: 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:46:11
63   |
64LL |     Tuple(Option<Option<u8>>),
65   |           ^^^^^^^^^^^^^^^^^^
66
67error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
68  --> $DIR/option_option.rs:48:17
69   |
70LL |     Struct { x: Option<Option<u8>> },
71   |                 ^^^^^^^^^^^^^^^^^^
72
73error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
74  --> $DIR/option_option.rs:90:14
75   |
76LL |         foo: Option<Option<Cow<'a, str>>>,
77   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78
79error: aborting due to 12 previous errors
80