Skip to content

Redundant E0106 missing lifetime error and rust_2018_idioms missing lifetime lint #63110

Closed
@estebank

Description

@estebank

While hacking in the compiler I got the following error:

error: hidden lifetime parameters in types are deprecated
   --> src/libsyntax_ext/format.rs:113:43
    |
113 |     arg_with_formatting_spans: Vec<(Span, parse::FormatSpec)>,
    |                                           ^^^^^^^^^^^^^^^^^- help: indicate the anonymous lifetime: `<'_>`
    |
note: lint level defined here
   --> src/libsyntax_ext/lib.rs:5:9
    |
5   | #![deny(rust_2018_idioms)]
    |         ^^^^^^^^^^^^^^^^
    = note: #[deny(elided_lifetimes_in_paths)] implied by #[deny(rust_2018_idioms)]

error[E0106]: missing lifetime specifier
   --> src/libsyntax_ext/format.rs:113:43
    |
113 |     arg_with_formatting_spans: Vec<(Span, parse::FormatSpec)>,
    |                                           ^^^^^^^^^^^^^^^^^ expected lifetime parameter

The errors are correct (and the lint is even helpful!) but they are 1) redundant and 2) E0106 is not as helpful as the rust_2018_idioms lint. We should get them both to parity and hide one if the other has triggered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-edition-2018Area: The 2018 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.L-elided_lifetimes_in_pathsLint: elided_lifetimes_in_pathsT-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