fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
612 B15 linesraw
1error[E0506]: cannot assign to `*x` because it is borrowed
2  --> $DIR/issue-75785-confusing-named-region.rs:9:5
3   |
4LL | pub async fn async_fn(x: &mut i32) -> (&i32, &i32) {
5   |                          - let's call the lifetime of this reference `'1`
6LL |     let y = &*x;
7   |             --- `*x` is borrowed here
8LL |     *x += 1;
9   |     ^^^^^^^ `*x` is assigned to here but it was already borrowed
10LL |     (&32, y)
11   |     -------- returning this value requires that `*x` is borrowed for `'1`
12
13error: aborting due to previous error
14
15For more information about this error, try `rustc --explain E0506`.