Skip to content

Instantly share code, notes, and snippets.

@cnd
Created March 26, 2019 07:30
Show Gist options
  • Save cnd/51404ba3b59473ee11c752ceafed4a66 to your computer and use it in GitHub Desktop.
Save cnd/51404ba3b59473ee11c752ceafed4a66 to your computer and use it in GitHub Desktop.
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> src/commands/owner.rs:15:48
|
15 | let sess = ssh_session.ref_rent(|iref| iref);
| ^^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime #3 defined on the body at 15:41...
--> src/commands/owner.rs:15:41
|
15 | let sess = ssh_session.ref_rent(|iref| iref);
| ^^^^^^^^^^^
= note: ...so that the expression is assignable:
expected &data::Sess<'_>
found &data::Sess<'_>
note: but, the lifetime must be valid for the method call at 15:20...
--> src/commands/owner.rs:15:20
|
15 | let sess = ssh_session.ref_rent(|iref| iref);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...so type `&data::Sess<'_>` of expression is valid during the expression
--> src/commands/owner.rs:15:20
|
15 | let sess = ssh_session.ref_rent(|iref| iref);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> src/handler.rs:146:62
|
146 | let sess = ssh_session.ref_rent(|iref| iref);
| ^^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime #3 defined on the body at 146:55...
--> src/handler.rs:146:55
|
146 | let sess = ssh_session.ref_rent(|iref| iref);
| ^^^^^^^^^^^
= note: ...so that the expression is assignable:
expected &data::Sess<'_>
found &data::Sess<'_>
note: but, the lifetime must be valid for the method call at 146:34...
--> src/handler.rs:146:34
|
146 | let sess = ssh_session.ref_rent(|iref| iref);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...so type `&data::Sess<'_>` of expression is valid during the expression
--> src/handler.rs:146:34
|
146 | let sess = ssh_session.ref_rent(|iref| iref);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment