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

unused-lifetimes lint false-positives with async functions #61115

Open
Seeker14491 opened this issue May 24, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@Seeker14491
Copy link
Contributor

commented May 24, 2019

Async functions that take references seem to always trigger the unused-lifetimes lint (which is allow-by-default). Example:

#![feature(async_await)]

#![warn(unused_lifetimes)]

pub async fn print(s: &str) {
    println!("{}", s);
}
warning: lifetime parameter `'_` never used
 --> src/lib.rs:5:23
  |
5 | pub async fn print(s: &str) {
  |                       ^
  |
@Seeker14491

This comment has been minimized.

Copy link
Contributor Author

commented May 24, 2019

I found this clippy issue which describes basically the same problem.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

commented Jun 4, 2019

Seeing as this lint is not enabled by default, marking as deferred, though this would be good to fix and probably not too hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.