You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using async-trait the compiler reports that the lifetimes do not match when no lifetimes are specified. Specifying a lifetime resolves the issue even though the lifetime is never used.
This crate requires #![feature(proc_macro_hygiene)] and thus requires nightly.
$ cargo check master
Checking enzyme v0.1.0 (/usr/dataplus/enzyme)
Checking user v0.1.0 (/usr/dataplus/enzyme/example/microservices/user)
error[E0195]: lifetime parameters or bounds on method `from_parts` do not match the trait declaration
--> src/context.rs:10:24
|
10 | async fn from_parts(_parts: Parts, _params: Params) -> WebResult<TokenContext> {
| ^ lifetimes do not match method in trait
error[E0195]: lifetime parameters or bounds on method `from_parts` do not match the trait declaration
--> src/context.rs:21:24
|
21 | async fn from_parts(parts: Parts, _params: Params) -> WebResult<AuthContext> {
| ^ lifetimes do not match method in trait
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0195`.
error: could not compile `user`.
To learn more, run the command again with --verbose.
When using
async-trait
the compiler reports that the lifetimes do not match when no lifetimes are specified. Specifying a lifetime resolves the issue even though the lifetime is never used.This crate requires
#![feature(proc_macro_hygiene)]
and thus requires nightly.Trait Definition:
https://github.com/technetos/enzyme/blob/master/src/context.rs#L7
Trait Usage:
https://github.com/technetos/enzyme/blob/master/example/microservices/user/src/context.rs#L10
and
https://github.com/technetos/enzyme/blob/master/example/microservices/user/src/context.rs#L21
Method of reproduction:
Remove the
<'a>
lifetime from the trait definition and the usages above. Runcargo check
The text was updated successfully, but these errors were encountered: