about summary refs log tree commit diff
path: root/tests/ui/generator/borrowing.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/generator/borrowing.stderr')
-rw-r--r--tests/ui/generator/borrowing.stderr20
1 files changed, 6 insertions, 14 deletions
diff --git a/tests/ui/generator/borrowing.stderr b/tests/ui/generator/borrowing.stderr
index 03a69fe3623..38e1ace8c4e 100644
--- a/tests/ui/generator/borrowing.stderr
+++ b/tests/ui/generator/borrowing.stderr
@@ -1,24 +1,16 @@
 error[E0597]: `a` does not live long enough
   --> $DIR/borrowing.rs:9:33
    |
+LL |     let _b = {
+   |         -- borrow later stored here
+LL |         let a = 3;
 LL |         Pin::new(&mut || yield &a).resume(())
-   |                       ----------^
-   |                       |         |
-   |                       |         borrowed value does not live long enough
+   |                       --        ^ borrowed value does not live long enough
+   |                       |
    |                       value captured here by generator
-   |                       a temporary with access to the borrow is created here ...
 LL |
 LL |     };
-   |     -- ... and the borrow might be used here, when that temporary is dropped and runs the destructor for generator
-   |     |
-   |     `a` dropped here while still borrowed
-   |
-   = note: the temporary is part of an expression at the end of a block;
-           consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
-help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
-   |
-LL |         let x = Pin::new(&mut || yield &a).resume(()); x
-   |         +++++++                                      +++
+   |     - `a` dropped here while still borrowed
 
 error[E0597]: `a` does not live long enough
   --> $DIR/borrowing.rs:16:20