rust/src/test/ui/regions/regions-creating-enums.nll.stderr

32 lines
1.4 KiB
Plaintext
Raw Normal View History

error[E0714]: temporary value dropped while borrowed
2018-08-08 07:28:26 -05:00
--> $DIR/regions-creating-enums.rs:33:17
|
LL | return &ast::num((*f)(x)); //~ ERROR borrowed value does not live long enough
| ^^^^^^^^^^^^^^^^^- temporary value is freed at the end of this statement
2018-08-08 07:28:26 -05:00
| |
| creates a temporary which is freed while still in use
2018-08-08 07:28:26 -05:00
|
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 30:13...
--> $DIR/regions-creating-enums.rs:30:13
|
LL | fn map_nums<'a,'b, F>(x: &ast, f: &mut F) -> &'a ast<'b> where F: FnMut(usize) -> usize {
| ^^
error[E0714]: temporary value dropped while borrowed
2018-08-08 07:28:26 -05:00
--> $DIR/regions-creating-enums.rs:38:17
|
LL | return &ast::add(m_x, m_y); //~ ERROR borrowed value does not live long enough
| ^^^^^^^^^^^^^^^^^^- temporary value is freed at the end of this statement
2018-08-08 07:28:26 -05:00
| |
| creates a temporary which is freed while still in use
2018-08-08 07:28:26 -05:00
|
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 30:13...
--> $DIR/regions-creating-enums.rs:30:13
|
LL | fn map_nums<'a,'b, F>(x: &ast, f: &mut F) -> &'a ast<'b> where F: FnMut(usize) -> usize {
| ^^
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0714`.