1 error[E0308]: mismatched types
2 --> $DIR/mut-ref-reassignment.rs:2:11
4 LL | fn suggestion(opt: &mut Option<String>) {
5 | ------------------- expected due to this parameter type
7 | ^^^^ expected mutable reference, found enum `Option`
9 = note: expected mutable reference `&mut Option<String>`
10 found enum `Option<_>`
11 help: consider dereferencing here to assign to the mutably borrowed value
16 error[E0308]: mismatched types
17 --> $DIR/mut-ref-reassignment.rs:6:11
19 LL | fn no_suggestion(opt: &mut Result<String, ()>) {
20 | ----------------------- expected due to this parameter type
22 | ^^^^ expected mutable reference, found enum `Option`
24 = note: expected mutable reference `&mut Result<String, ()>`
25 found enum `Option<_>`
27 error[E0308]: mismatched types
28 --> $DIR/mut-ref-reassignment.rs:10:11
30 LL | fn suggestion2(opt: &mut Option<String>) {
31 | ------------------- expected due to this parameter type
32 LL | opt = Some(String::new())
33 | ^^^^^^^^^^^^^^^^^^^ expected mutable reference, found enum `Option`
35 = note: expected mutable reference `&mut Option<String>`
36 found enum `Option<String>`
37 help: consider dereferencing here to assign to the mutably borrowed value
39 LL | *opt = Some(String::new())
42 error[E0308]: mismatched types
43 --> $DIR/mut-ref-reassignment.rs:14:11
45 LL | fn no_suggestion2(opt: &mut Option<String>) {
46 | ------------------- expected due to this parameter type
48 | ^^^^^^^^ expected mutable reference, found enum `Option`
50 = note: expected mutable reference `&mut Option<String>`
51 found enum `Option<{integer}>`
53 error: aborting due to 4 previous errors
55 For more information about this error, try `rustc --explain E0308`.