|
1 | 1 | error[E0308]: mismatched types
|
2 | 2 | --> $DIR/mut-ref-reassignment.rs:2:11
|
3 | 3 | |
|
4 |
| -LL | opt = None |
| 4 | +LL | opt = None; |
5 | 5 | | ^^^^ expected mutable reference, found enum `std::option::Option`
|
6 | 6 | |
|
7 | 7 | = note: expected type `&mut std::option::Option<std::string::String>`
|
8 | 8 | found type `std::option::Option<_>`
|
9 | 9 | help: consider dereferencing here to assign to the mutable borrowed piece of memory
|
10 | 10 | |
|
11 |
| -LL | *opt = None |
| 11 | +LL | *opt = None; |
12 | 12 | | ^^^^
|
13 | 13 |
|
14 |
| -error: aborting due to previous error |
| 14 | +error[E0308]: mismatched types |
| 15 | + --> $DIR/mut-ref-reassignment.rs:6:11 |
| 16 | + | |
| 17 | +LL | opt = None |
| 18 | + | ^^^^ expected mutable reference, found enum `std::option::Option` |
| 19 | + | |
| 20 | + = note: expected type `&mut std::result::Result<std::string::String, ()>` |
| 21 | + found type `std::option::Option<_>` |
| 22 | + |
| 23 | +error[E0308]: mismatched types |
| 24 | + --> $DIR/mut-ref-reassignment.rs:10:11 |
| 25 | + | |
| 26 | +LL | opt = Some(String::new()) |
| 27 | + | ^^^^^^^^^^^^^^^^^^^ expected mutable reference, found enum `std::option::Option` |
| 28 | + | |
| 29 | + = note: expected type `&mut std::option::Option<std::string::String>` |
| 30 | + found type `std::option::Option<std::string::String>` |
| 31 | +help: consider dereferencing here to assign to the mutable borrowed piece of memory |
| 32 | + | |
| 33 | +LL | *opt = Some(String::new()) |
| 34 | + | ^^^^ |
| 35 | + |
| 36 | +error[E0308]: mismatched types |
| 37 | + --> $DIR/mut-ref-reassignment.rs:14:11 |
| 38 | + | |
| 39 | +LL | opt = Some(42) |
| 40 | + | ^^^^^^^^ expected mutable reference, found enum `std::option::Option` |
| 41 | + | |
| 42 | + = note: expected type `&mut std::option::Option<std::string::String>` |
| 43 | + found type `std::option::Option<{integer}>` |
| 44 | + |
| 45 | +error: aborting due to 4 previous errors |
15 | 46 |
|
16 | 47 | For more information about this error, try `rustc --explain E0308`.
|
0 commit comments