fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

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