]> git.proxmox.com Git - rustc.git/blob - src/test/ui/error-codes/E0621-does-not-trigger-for-closures.stderr
New upstream version 1.26.0+dfsg1
[rustc.git] / src / test / ui / error-codes / E0621-does-not-trigger-for-closures.stderr
1 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
2 --> $DIR/E0621-does-not-trigger-for-closures.rs:25:5
3 |
4 LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
5 | ^^^^^^
6 |
7 note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 25:16...
8 --> $DIR/E0621-does-not-trigger-for-closures.rs:25:16
9 |
10 LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 note: ...so that reference does not outlive borrowed content
13 --> $DIR/E0621-does-not-trigger-for-closures.rs:25:45
14 |
15 LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
16 | ^
17 note: but, the lifetime must be valid for the call at 25:5...
18 --> $DIR/E0621-does-not-trigger-for-closures.rs:25:5
19 |
20 LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
21 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22 note: ...so type `&i32` of expression is valid during the expression
23 --> $DIR/E0621-does-not-trigger-for-closures.rs:25:5
24 |
25 LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
26 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27
28 error: aborting due to previous error
29
30 For more information about this error, try `rustc --explain E0495`.