Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"elided_named_lifetimes" lint in latest Rust nightly #279

Closed
nazar-pc opened this issue Sep 26, 2024 · 1 comment
Closed

"elided_named_lifetimes" lint in latest Rust nightly #279

nazar-pc opened this issue Sep 26, 2024 · 1 comment

Comments

@nazar-pc
Copy link

nazar-pc commented Sep 26, 2024

I have a function of this kind under async_trait:

    async fn contents(
        &self,
    ) -> Box<
          dyn Stream<Item = Result<ABC, FarmError>>
              + Unpin
              + Send
              + '_,
    > {
    }

In latest nightly I'm getting the following warning:

    |
111 |         &self,
    |         - lifetime `'life0` declared here
...
117 |                 + '_,
    |                   ^^ this elided lifetime gets resolved as `'life0`
    |
    = note: `#[warn(elided_named_lifetimes)]` on by default

It comes from generated code and I'm reluctant to actually writing 'life0 explicitly in such cases.

Would be nice to convert these it in the macro automatically.

@dtolnay
Copy link
Owner

dtolnay commented Sep 27, 2024

This was fixed several weeks ago.

@dtolnay dtolnay closed this as completed Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants