about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui-toml/ref_option/ref_option.all.stderr
blob: 45ce105e03084362c75b7f256a330a952818034f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
  --> tests/ui-toml/ref_option/ref_option.rs:9:1
   |
LL | fn opt_u8(a: &Option<u8>) {}
   | ^^^^^^^^^^^^^-----------^^^^
   |              |
   |              help: change this to: `Option<&u8>`
   |
   = note: `-D clippy::ref-option` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::ref_option)]`

error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
  --> tests/ui-toml/ref_option/ref_option.rs:11:1
   |
LL | fn opt_gen<T>(a: &Option<T>) {}
   | ^^^^^^^^^^^^^^^^^----------^^^^
   |                  |
   |                  help: change this to: `Option<&T>`

error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
  --> tests/ui-toml/ref_option/ref_option.rs:13:1
   |
LL | fn opt_string(a: &std::option::Option<String>) {}
   | ^^^^^^^^^^^^^^^^^----------------------------^^^^
   |                  |
   |                  help: change this to: `std::option::Option<&String>`

error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
  --> tests/ui-toml/ref_option/ref_option.rs:15:1
   |
LL |   fn ret_u8<'a>(p: &'a str) -> &'a Option<u8> {
   |   ^                            -------------- help: change this to: `Option<&'a u8>`
   |  _|
   | |
LL | |
LL | |     panic!()
LL | | }
   | |_^

error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
  --> tests/ui-toml/ref_option/ref_option.rs:19:1
   |
LL |   fn ret_u8_static() -> &'static Option<u8> {
   |   ^                     ------------------- help: change this to: `Option<&'static u8>`
   |  _|
   | |
LL | |
LL | |     panic!()
LL | | }
   | |_^

error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
  --> tests/ui-toml/ref_option/ref_option.rs:23:1
   |
LL | fn mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: change this to
   |
LL - fn mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
LL + fn mult_string(a: Option<&String>, b: Option<&Vec<u8>>) {}
   |

error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
  --> tests/ui-toml/ref_option/ref_option.rs:25:1
   |
LL |   fn ret_box<'a>() -> &'a Option<Box<u8>> {
   |   ^                   ------------------- help: change this to: `Option<&'a Box<u8>>`
   |  _|
   | |
LL | |
LL | |     panic!()
LL | | }
   | |_^

error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
  --> tests/ui-toml/ref_option/ref_option.rs:30:1
   |
LL | pub fn pub_opt_string(a: &Option<String>) {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^---------------^^^^
   |                          |
   |                          help: change this to: `Option<&String>`

error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
  --> tests/ui-toml/ref_option/ref_option.rs:32:1
   |
LL | pub fn pub_mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: change this to
   |
LL - pub fn pub_mult_string(a: &Option<String>, b: &Option<Vec<u8>>) {}
LL + pub fn pub_mult_string(a: Option<&String>, b: Option<&Vec<u8>>) {}
   |

error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
  --> tests/ui-toml/ref_option/ref_option.rs:38:5
   |
LL |     pub fn pub_opt_params(&self, a: &Option<()>) {}
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^
   |                                     |
   |                                     help: change this to: `Option<&()>`

error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
  --> tests/ui-toml/ref_option/ref_option.rs:40:5
   |
LL |       pub fn pub_opt_ret(&self) -> &Option<String> {
   |       ^                            --------------- help: change this to: `Option<&String>`
   |  _____|
   | |
LL | |
LL | |         panic!()
LL | |     }
   | |_____^

error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
  --> tests/ui-toml/ref_option/ref_option.rs:45:5
   |
LL |     fn private_opt_params(&self, a: &Option<()>) {}
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^
   |                                     |
   |                                     help: change this to: `Option<&()>`

error: it is more idiomatic to use `Option<&T>` instead of `&Option<T>`
  --> tests/ui-toml/ref_option/ref_option.rs:47:5
   |
LL |       fn private_opt_ret(&self) -> &Option<String> {
   |       ^                            --------------- help: change this to: `Option<&String>`
   |  _____|
   | |
LL | |
LL | |         panic!()
LL | |     }
   | |_____^

error: aborting due to 13 previous errors