Skip to content

Bad lint suggestion: '_ in type definition #61124

Closed
@mark-i-m

Description

@mark-i-m

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=af7140af40052d9c78faf8897ce19525

#![deny(rust_2018_idioms)]

struct Bar<'a> { x: &'a u8 }

struct Foo(Bar);
error: hidden lifetime parameters in types are deprecated
 --> src/lib.rs:6:12
  |
6 | struct Foo(Bar);
  |            ^^^- help: indicate the anonymous lifetime: `<'_>`
  |

Except that using '_ is not allowed in the type definition...

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.T-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