]> git.proxmox.com Git - rustc.git/blame - src/test/ui/async-await/issue-74072-lifetime-name-annotations.stderr
New upstream version 1.65.0+dfsg1
[rustc.git] / src / test / ui / async-await / issue-74072-lifetime-name-annotations.stderr
CommitLineData
29967ef6
XL
1error[E0506]: cannot assign to `*x` because it is borrowed
2 --> $DIR/issue-74072-lifetime-name-annotations.rs:9:5
3 |
4LL | pub async fn async_fn(x: &mut i32) -> &i32 {
fc512014 5 | - let's call the lifetime of this reference `'1`
29967ef6
XL
6LL | let y = &*x;
7 | --- borrow of `*x` occurs here
8LL | *x += 1;
9 | ^^^^^^^ assignment to borrowed `*x` occurs here
10LL | y
11 | - returning this value requires that `*x` is borrowed for `'1`
12
13error[E0506]: cannot assign to `*x` because it is borrowed
14 --> $DIR/issue-74072-lifetime-name-annotations.rs:16:9
15 |
16LL | let y = &*x;
17 | --- borrow of `*x` occurs here
18LL | *x += 1;
19 | ^^^^^^^ assignment to borrowed `*x` occurs here
20LL | y
21 | - returning this value requires that `*x` is borrowed for `'1`
22LL | })()
23 | - return type of async closure is &'1 i32
24
25error[E0506]: cannot assign to `*x` because it is borrowed
26 --> $DIR/issue-74072-lifetime-name-annotations.rs:24:9
27 |
28LL | (async move || -> &i32 {
29 | - let's call the lifetime of this reference `'1`
30LL | let y = &*x;
31 | --- borrow of `*x` occurs here
32LL | *x += 1;
33 | ^^^^^^^ assignment to borrowed `*x` occurs here
34LL | y
35 | - returning this value requires that `*x` is borrowed for `'1`
36
37error[E0506]: cannot assign to `*x` because it is borrowed
38 --> $DIR/issue-74072-lifetime-name-annotations.rs:32:9
39 |
40LL | let y = &*x;
41 | --- borrow of `*x` occurs here
42LL | *x += 1;
43 | ^^^^^^^ assignment to borrowed `*x` occurs here
44LL | y
45 | - returning this value requires that `*x` is borrowed for `'1`
46LL | }
47 | - return type of async block is &'1 i32
48
49error: aborting due to 4 previous errors
50
51For more information about this error, try `rustc --explain E0506`.