-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Given the following code:
#![warn(unused_lifetimes)]
use std::borrow::Cow;
pub async fn do_thing(s: Cow<'_, str>) -> Cow<'_, str> {
s
}
The current output is:
warning: lifetime parameter `'_` never used
--> src/main.rs:5:47
|
5 | pub async fn do_thing(s: Cow<'_, str>) -> Cow<'_, str> {
| -----------------^^
| |
| help: elide the unused lifetime
|
Removing the word async
makes the warning disappear. I am currently running 1.52.1, and this also happens in 1.53.0 on the playground, as well as 1.55.0 nightly on the playground.
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.