@@ -5,7 +5,7 @@ LL | let x = { *r };
55 | ^^
66 | |
77 | move occurs because `*r` has type `std::string::String`, which does not implement the `Copy` trait
8- | help: consider removing the `*` : `r`
8+ | help: consider borrowing here : `&* r`
99
1010error[E0507]: cannot move out of `*r` which is behind a shared reference
1111 --> $DIR/cannot-move-block-spans.rs:6:22
@@ -14,7 +14,7 @@ LL | let y = unsafe { *r };
1414 | ^^
1515 | |
1616 | move occurs because `*r` has type `std::string::String`, which does not implement the `Copy` trait
17- | help: consider removing the `*` : `r`
17+ | help: consider borrowing here : `&* r`
1818
1919error[E0507]: cannot move out of `*r` which is behind a shared reference
2020 --> $DIR/cannot-move-block-spans.rs:7:26
@@ -23,7 +23,7 @@ LL | let z = loop { break *r; };
2323 | ^^
2424 | |
2525 | move occurs because `*r` has type `std::string::String`, which does not implement the `Copy` trait
26- | help: consider removing the `*` : `r`
26+ | help: consider borrowing here : `&* r`
2727
2828error[E0508]: cannot move out of type `[std::string::String; 2]`, a non-copy array
2929 --> $DIR/cannot-move-block-spans.rs:11:15
@@ -62,7 +62,7 @@ LL | let x = { let mut u = 0; u += 1; *r };
6262 | ^^
6363 | |
6464 | move occurs because `*r` has type `std::string::String`, which does not implement the `Copy` trait
65- | help: consider removing the `*` : `r`
65+ | help: consider borrowing here : `&* r`
6666
6767error[E0507]: cannot move out of `*r` which is behind a shared reference
6868 --> $DIR/cannot-move-block-spans.rs:18:45
@@ -71,7 +71,7 @@ LL | let y = unsafe { let mut u = 0; u += 1; *r };
7171 | ^^
7272 | |
7373 | move occurs because `*r` has type `std::string::String`, which does not implement the `Copy` trait
74- | help: consider removing the `*` : `r`
74+ | help: consider borrowing here : `&* r`
7575
7676error[E0507]: cannot move out of `*r` which is behind a shared reference
7777 --> $DIR/cannot-move-block-spans.rs:19:49
@@ -80,7 +80,7 @@ LL | let z = loop { let mut u = 0; u += 1; break *r; u += 2; };
8080 | ^^
8181 | |
8282 | move occurs because `*r` has type `std::string::String`, which does not implement the `Copy` trait
83- | help: consider removing the `*` : `r`
83+ | help: consider borrowing here : `&* r`
8484
8585error: aborting due to 9 previous errors
8686
0 commit comments