]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/async-await/issue-74072-lifetime-name-annotations.stderr
Rollup merge of #103766 - lukas-code:error-in-core, r=Dylan-DPC
[rust.git] / src / test / ui / async-await / issue-74072-lifetime-name-annotations.stderr
index 80504613eb4e3c2f546aa78b5d90c883db406608..b96cab9f0f51affffcac89671167a6490b5cc134 100644 (file)
@@ -1,10 +1,14 @@
 error[E0506]: cannot assign to `*x` because it is borrowed
   --> $DIR/issue-74072-lifetime-name-annotations.rs:9:5
    |
+LL | pub async fn async_fn(x: &mut i32) -> &i32 {
+   |                          - let's call the lifetime of this reference `'1`
 LL |     let y = &*x;
    |             --- borrow of `*x` occurs here
 LL |     *x += 1;
    |     ^^^^^^^ assignment to borrowed `*x` occurs here
+LL |     y
+   |     - returning this value requires that `*x` is borrowed for `'1`
 
 error[E0506]: cannot assign to `*x` because it is borrowed
   --> $DIR/issue-74072-lifetime-name-annotations.rs:16:9