blob: 6ca1a2374610e67d9196b8125204538ae689b703 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
error[E0308]: mismatched types
--> $DIR/option_mut_coerce_shared.rs:5:12
|
LL | method(a);
| ------ ^ types differ in mutability
| |
| arguments to this function are incorrect
|
= note: expected enum `Option<&()>`
found enum `Option<&mut ()>`
note: function defined here
--> $DIR/option_mut_coerce_shared.rs:1:4
|
LL | fn method(a: Option<&()>) {}
| ^^^^^^ --------------
help: try using `.as_deref()` to convert `Option<&mut ()>` to `Option<&()>`
|
LL | method(a.as_deref());
| +++++++++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0308`.
|