error[E0308]: mismatched types --> $DIR/mut-ref-reassignment.rs:2:11 | LL | opt = None; | ^^^^ expected mutable reference, found enum `std::option::Option` | = note: expected type `&mut std::option::Option` found type `std::option::Option<_>` help: consider dereferencing here to assign to the mutable borrowed piece of memory | LL | *opt = None; | ^^^^ error[E0308]: mismatched types --> $DIR/mut-ref-reassignment.rs:6:11 | LL | opt = None | ^^^^ expected mutable reference, found enum `std::option::Option` | = note: expected type `&mut std::result::Result` found type `std::option::Option<_>` error[E0308]: mismatched types --> $DIR/mut-ref-reassignment.rs:10:11 | LL | opt = Some(String::new()) | ^^^^^^^^^^^^^^^^^^^ expected mutable reference, found enum `std::option::Option` | = note: expected type `&mut std::option::Option` found type `std::option::Option` help: consider dereferencing here to assign to the mutable borrowed piece of memory | LL | *opt = Some(String::new()) | ^^^^ error[E0308]: mismatched types --> $DIR/mut-ref-reassignment.rs:14:11 | LL | opt = Some(42) | ^^^^^^^^ expected mutable reference, found enum `std::option::Option` | = note: expected type `&mut std::option::Option` found type `std::option::Option<{integer}>` error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0308`.