-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.L-single_use_lifetimesLint: single_use_lifetimesLint: single_use_lifetimesT-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
Repro (on 1.28-stable to 1.31-nightly)
#![warn(single_use_lifetimes)]
pub trait Tfv<'a>: Sized {
const FOO: &'a u8;
}
pub fn g<T: for<'a> Tfv<'a>>() {}
Unexpected lint result:
warning: lifetime parameter `'a` only used once
--> src/lib.rs:7:17
|
7 | pub fn g<T: for<'a> Tfv<'a>>() {}
| ^^ -- ...is used only here
| |
| this lifetime...
|
Unless we intend to support T: Tfv<'_>
, there shouldn't be a lint here. cc #44752.
EFanZh
Metadata
Metadata
Assignees
Labels
A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.L-single_use_lifetimesLint: single_use_lifetimesLint: single_use_lifetimesT-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.