1 error[E0597]: borrowed value does not live long enough
2 --> $DIR/regions-creating-enums.rs:33:17
4 LL | return &ast::num((*f)(x)); //~ ERROR borrowed value does not live long enough
5 | ^^^^^^^^^^^^^^^^^- temporary value only lives until here
7 | temporary value does not live long enough
9 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 30:13...
10 --> $DIR/regions-creating-enums.rs:30:13
12 LL | fn map_nums<'a,'b, F>(x: &ast, f: &mut F) -> &'a ast<'b> where F: FnMut(usize) -> usize {
14 = note: consider using a `let` binding to increase its lifetime
16 error[E0597]: borrowed value does not live long enough
17 --> $DIR/regions-creating-enums.rs:38:17
19 LL | return &ast::add(m_x, m_y); //~ ERROR borrowed value does not live long enough
20 | ^^^^^^^^^^^^^^^^^^- temporary value only lives until here
22 | temporary value does not live long enough
24 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 30:13...
25 --> $DIR/regions-creating-enums.rs:30:13
27 LL | fn map_nums<'a,'b, F>(x: &ast, f: &mut F) -> &'a ast<'b> where F: FnMut(usize) -> usize {
29 = note: consider using a `let` binding to increase its lifetime
31 error: aborting due to 2 previous errors
33 For more information about this error, try `rustc --explain E0597`.