fork/rust

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

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
984 B26 linesraw
1error[E0503]: cannot use `*y.pointer` because it was mutably borrowed
2  --> $DIR/issue-45697-1.rs:20:9
3   |
4LL |         let z = copy_borrowed_ptr(&mut y);
5   |                                   ------ borrow of `y` occurs here
6LL |         *y.pointer += 1;
7   |         ^^^^^^^^^^^^^^^ use of borrowed `y`
8...
9LL |         *z.pointer += 1;
10   |         --------------- borrow later used here
11
12error[E0506]: cannot assign to `*y.pointer` because it is borrowed
13  --> $DIR/issue-45697-1.rs:20:9
14   |
15LL |         let z = copy_borrowed_ptr(&mut y);
16   |                                   ------ borrow of `*y.pointer` occurs here
17LL |         *y.pointer += 1;
18   |         ^^^^^^^^^^^^^^^ assignment to borrowed `*y.pointer` occurs here
19...
20LL |         *z.pointer += 1;
21   |         --------------- borrow later used here
22
23error: aborting due to 2 previous errors
24
25Some errors have detailed explanations: E0503, E0506.
26For more information about an error, try `rustc --explain E0503`.