1 error[E0308]: mismatched types
2 --> $DIR/issue-100605.rs:4:18
4 LL | takes_option(&None);
5 | ------------ ^^^^^ expected enum `Option`, found `&Option<_>`
7 | arguments to this function are incorrect
9 = note: expected enum `Option<&String>`
10 found reference `&Option<_>`
11 note: function defined here
12 --> $DIR/issue-100605.rs:1:4
14 LL | fn takes_option(_arg: Option<&String>) {}
15 | ^^^^^^^^^^^^ ---------------------
16 help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`
18 LL | takes_option(None.as_ref());
20 help: consider removing the borrow
22 LL - takes_option(&None);
23 LL + takes_option(None);
26 error[E0308]: mismatched types
27 --> $DIR/issue-100605.rs:8:18
29 LL | takes_option(&res);
32 | | expected enum `Option`, found `&Option<String>`
33 | | help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`: `res.as_ref()`
34 | arguments to this function are incorrect
36 = note: expected enum `Option<&String>`
37 found reference `&Option<String>`
38 note: function defined here
39 --> $DIR/issue-100605.rs:1:4
41 LL | fn takes_option(_arg: Option<&String>) {}
42 | ^^^^^^^^^^^^ ---------------------
44 error: aborting due to 2 previous errors
46 For more information about this error, try `rustc --explain E0308`.