rust/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.stderr

31 lines
1.4 KiB
Plaintext
Raw Normal View History

2018-02-07 21:35:35 -06:00
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
--> $DIR/E0621-does-not-trigger-for-closures.rs:25:5
|
2018-02-22 18:42:32 -06:00
LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
2018-02-07 21:35:35 -06:00
| ^^^^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 25:16...
--> $DIR/E0621-does-not-trigger-for-closures.rs:25:16
|
2018-02-22 18:42:32 -06:00
LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
2018-02-07 21:35:35 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...so that reference does not outlive borrowed content
--> $DIR/E0621-does-not-trigger-for-closures.rs:25:45
|
2018-02-22 18:42:32 -06:00
LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
2018-02-07 21:35:35 -06:00
| ^
note: but, the lifetime must be valid for the call at 25:5...
--> $DIR/E0621-does-not-trigger-for-closures.rs:25:5
|
2018-02-22 18:42:32 -06:00
LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
2018-02-07 21:35:35 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...so type `&i32` of expression is valid during the expression
--> $DIR/E0621-does-not-trigger-for-closures.rs:25:5
|
2018-02-22 18:42:32 -06:00
LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
2018-02-07 21:35:35 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
2018-02-19 14:40:25 -06:00
If you want more information on this error, try using "rustc --explain E0495"