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