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