rust/src/test/ui/regions/regions-escape-method.stderr

29 lines
960 B
Plaintext
Raw Normal View History

2018-08-08 07:28:26 -05:00
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
2018-12-25 09:56:47 -06:00
--> $DIR/regions-escape-method.rs:15:13
2018-08-08 07:28:26 -05:00
|
LL | s.f(|p| p) //~ ERROR cannot infer
| ^
|
2018-12-25 09:56:47 -06:00
note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 15:9...
--> $DIR/regions-escape-method.rs:15:9
2018-08-08 07:28:26 -05:00
|
LL | s.f(|p| p) //~ ERROR cannot infer
| ^^^^^
= note: ...so that the expression is assignable:
expected &i32
found &i32
2018-12-25 09:56:47 -06:00
note: but, the lifetime must be valid for the method call at 15:5...
--> $DIR/regions-escape-method.rs:15:5
2018-08-08 07:28:26 -05:00
|
LL | s.f(|p| p) //~ ERROR cannot infer
| ^^^^^^^^^^
note: ...so that a type/lifetime parameter is in scope here
2018-12-25 09:56:47 -06:00
--> $DIR/regions-escape-method.rs:15:5
2018-08-08 07:28:26 -05:00
|
LL | s.f(|p| p) //~ ERROR cannot infer
| ^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0495`.