]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issue-75785-confusing-named-region.stderr
Auto merge of #83152 - guswynn:jemallocator_part2, r=Mark-Simulacrum
[rust.git] / src / test / ui / async-await / issue-75785-confusing-named-region.stderr
1 error[E0506]: cannot assign to `*x` because it is borrowed
2   --> $DIR/issue-75785-confusing-named-region.rs:9:5
3    |
4 LL | pub async fn async_fn(x: &mut i32) -> (&i32, &i32) {
5    |                          - let's call the lifetime of this reference `'1`
6 LL |     let y = &*x;
7    |             --- borrow of `*x` occurs here
8 LL |     *x += 1;
9    |     ^^^^^^^ assignment to borrowed `*x` occurs here
10 LL |     (&32, y)
11    |     -------- returning this value requires that `*x` is borrowed for `'1`
12
13 error: aborting due to previous error
14
15 For more information about this error, try `rustc --explain E0506`.