Skip to content

single_use_lifetimes warns when deriving a struct #53738

Closed
@TimDiekmann

Description

@TimDiekmann

When compiling

#![warn(single_use_lifetimes)]

#[derive(Debug)]
struct Foo<'a> {
    bar: &'a u32,
}

this warning is generated:

warning: lifetime parameter `'a` only used once
 --> src/lib.rs:5:12
  |
5 | struct Foo<'a> {
  |            ^^
  |

I think, #[automatically_derived] in the Debug derive does not consider this lint.

Metadata

Metadata

Assignees

Labels

A-edition-2018Area: The 2018 editionA-lifetimesArea: Lifetimes / regionsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions