Description
Issue #53738 seems to have regressed.
I tried this code:
#[deny(single_use_lifetimes)]
#[derive(Eq)]
struct Foo<'a, T> {
/// a reference to the underlying secret data that will be derefed
pub data: &'a mut T,
}
I expected to see this happen: No warning should be produced.
Instead, this happened:
error: lifetime parameter `'a` only used once
--> src/lib.rs:4:12
|
3 | #[derive(Eq)]
| -- ...is used only here
4 | struct Foo<'a, T> {
| ^^ this lifetime...
|
note: lint level defined here
--> src/lib.rs:1:8
|
1 | #[deny(single_use_lifetimes)]
| ^^^^^^^^^^^^^^^^^^^^
Meta
rustc --version --verbose
:
rustc 1.42.0 (b8cedc004 2020-03-09)
binary: rustc
commit-hash: b8cedc00407a4c56a3bda1ed605c6fc166655447
commit-date: 2020-03-09
host: x86_64-apple-darwin
release: 1.42.0
LLVM version: 9.0
Metadata
Metadata
Assignees
Labels
Area: The 2018 editionArea: Lifetimes / regionsArea: Lints (warnings about flaws in source code) such as unused_mut.Category: This is a bug.`single_use_lifetimes` lintHelping to "clean up" bugs with minimal examples and bisectionsMedium priorityRelevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from one stable version to another.