1 error[E0597]: `y` does not live long enough
2 --> $DIR/issue-23338-locals-die-before-temps-of-body.rs:10:5
4 LL | y.borrow().clone()
7 | borrowed value does not live long enough
8 | a temporary with access to the borrow is created here ...
12 | `y` dropped here while still borrowed
13 | ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `Ref<'_, String>`
15 = note: the temporary is part of an expression at the end of a block;
16 consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
17 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
19 LL | let x = y.borrow().clone(); x
22 error[E0597]: `y` does not live long enough
23 --> $DIR/issue-23338-locals-die-before-temps-of-body.rs:17:9
25 LL | y.borrow().clone()
28 | borrowed value does not live long enough
29 | a temporary with access to the borrow is created here ...
31 | -- ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `Ref<'_, String>`
33 | `y` dropped here while still borrowed
35 = note: the temporary is part of an expression at the end of a block;
36 consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
37 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
39 LL | let x = y.borrow().clone(); x
42 error: aborting due to 2 previous errors
44 For more information about this error, try `rustc --explain E0597`.