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