blob: fe4b97a33b5cf28ce68c2c2670641b190ebc0940 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
error[E0515]: cannot return reference to temporary value
--> $DIR/regions-creating-enums.rs:23:16
|
LL | return &Ast::Num((*f)(x)); //~ ERROR borrowed value does not live long enough
| ^-----------------
| ||
| |temporary value created here
| returns a reference to data owned by the current function
error[E0515]: cannot return reference to temporary value
--> $DIR/regions-creating-enums.rs:28:16
|
LL | return &Ast::Add(m_x, m_y); //~ ERROR borrowed value does not live long enough
| ^------------------
| ||
| |temporary value created here
| returns a reference to data owned by the current function
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0515`.
|