Skip to content

Bad interaction of async functions with unused_lifetimes lint #78522

@c410-f3r

Description

@c410-f3r
Contributor

The following shouldn't trigger the lint:

#![forbid(unused_lifetimes)]

pub async fn stuff<'a, I>(_: I) 
where
    I: Iterator<Item = &'a i32>
{
}

Also happens with &'a self or &'a mut self parameters

Activity

added
A-lifetimesArea: Lifetimes / regions
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
on Oct 29, 2020
added
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Oct 29, 2020
added
AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.
on Nov 19, 2020
tmandry

tmandry commented on Nov 19, 2020

@tmandry
Member

Odd, it looks like the lint is broken for async fns. We definitely want to fix this.

If anyone wants to take this on, the place to start is check_uses_for_lifetimes_defined_by_scope and reading / logging to understand how async functions are handled differently.

added
E-help-wantedCall for participation: Help is requested to fix this issue.
on Nov 19, 2020
Vooblin

Vooblin commented on Dec 1, 2020

@Vooblin
Contributor

Hello!
I'm new in the Rust community and I'm going to actively contribute in Rust. I would like to start with this issue.

Vooblin

Vooblin commented on Dec 7, 2020

@Vooblin
Contributor

@rustbot claim

c410-f3r

c410-f3r commented on Dec 7, 2020

@c410-f3r
ContributorAuthor

@Vooblin Thank you!

tmandry

tmandry commented on Jan 9, 2021

@tmandry
Member

Ping from triage. @Vooblin are you still interested in working on this?

c410-f3r

c410-f3r commented on Jan 9, 2021

@c410-f3r
ContributorAuthor
tmandry

tmandry commented on Jan 9, 2021

@tmandry
Member

Oops ☺️ sorry about that. This slipped through my email filters. I'll give it a review next week.

added a commit that references this issue on Jan 14, 2021
ee6ff66
added a commit that references this issue on Jan 14, 2021
05f5db4
added a commit that references this issue on Jan 14, 2021
tmandry

tmandry commented on Jan 15, 2021

@tmandry
Member

Fixed in #79689

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-async-awaitArea: Async & AwaitA-lifetimesArea: Lifetimes / regionsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.E-help-wantedCall for participation: Help is requested to fix this issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @jonas-schievink@tmandry@c410-f3r@jyn514@Vooblin

      Issue actions

        Bad interaction of async functions with unused_lifetimes lint · Issue #78522 · rust-lang/rust