]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-creating-enums.stderr
Auto merge of #58995 - Centril:refactor-build-manifest, r=alexcrichton
[rust.git] / src / test / ui / regions / regions-creating-enums.stderr
1 error[E0597]: borrowed value does not live long enough
2   --> $DIR/regions-creating-enums.rs:23:17
3    |
4 LL |         return &Ast::Num((*f)(x));
5    |                 ^^^^^^^^^^^^^^^^^- temporary value only lives until here
6    |                 |
7    |                 temporary value does not live long enough
8    |
9 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 20:13...
10   --> $DIR/regions-creating-enums.rs:20:13
11    |
12 LL | fn map_nums<'a,'b, F>(x: &Ast, f: &mut F) -> &'a Ast<'b> where F: FnMut(usize) -> usize {
13    |             ^^
14    = note: consider using a `let` binding to increase its lifetime
15
16 error[E0597]: borrowed value does not live long enough
17   --> $DIR/regions-creating-enums.rs:28:17
18    |
19 LL |         return &Ast::Add(m_x, m_y);
20    |                 ^^^^^^^^^^^^^^^^^^- temporary value only lives until here
21    |                 |
22    |                 temporary value does not live long enough
23    |
24 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 20:13...
25   --> $DIR/regions-creating-enums.rs:20:13
26    |
27 LL | fn map_nums<'a,'b, F>(x: &Ast, f: &mut F) -> &'a Ast<'b> where F: FnMut(usize) -> usize {
28    |             ^^
29    = note: consider using a `let` binding to increase its lifetime
30
31 error: aborting due to 2 previous errors
32
33 For more information about this error, try `rustc --explain E0597`.