Closed
Description
Repro (on 1.27-stable to 1.31-nightly):
#![warn(single_use_lifetimes)]
pub trait Tfv<'a>: Sized {
fn tfv(x: &'a str) -> Option<Self>;
// fn shut_up_single_use_lifetimes(_: &'a ()) {} // uncomment to shut up the lint 😕
}
Unexpected lint result:
warning: lifetime parameter `'a` only used once
--> src/lib.rs:3:15
|
3 | pub trait Tfv<'a>: Sized {
| ^^ this lifetime...
4 | fn tfv(x: &'a str) -> Option<Self>;
| -- ...is used only here
|
cc #44752