blob: 8d2de67382bd8b73d7ad4174386b47763556b035 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
error[E0597]: `l` does not live long enough
--> $DIR/span-semicolon-issue-139049.rs:11:41
|
LL | macro_rules! perform { ($e:expr) => { D(&$e).end() } }
| --^^^-
| | |
| | borrowed value does not live long enough
| a temporary with access to the borrow is created here ...
...
LL | { let l = (); perform!(l) };
| - ----------- -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
| | | |
| | | `l` dropped here while still borrowed
| | in this macro invocation
| binding `l` declared here
|
= note: this error originates in the macro `perform` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | { let l = (); perform!(l); };
| +
error[E0597]: `l` does not live long enough
--> $DIR/span-semicolon-issue-139049.rs:11:41
|
LL | macro_rules! perform { ($e:expr) => { D(&$e).end() } }
| --^^^-
| | |
| | borrowed value does not live long enough
| a temporary with access to the borrow is created here ...
...
LL | let _x = { let l = (); perform!(l) };
| - ----------- -- ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
| | | |
| | | `l` dropped here while still borrowed
| | in this macro invocation
| binding `l` declared here
|
= 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
= note: this error originates in the macro `perform` (in Nightly builds, run with -Z macro-backtrace for more info)
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 = { let l = (); let x = perform!(l); x };
| +++++++ +++
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0597`.
|