Skip to content

fix false negatives in explicit_outlives_requirements  #54630

Open

Description

@zackmdavis

Niko Matsakis points out that the explicit_outlives_requirements lint (from #53013, expected to land soon) should also fire on lifetime-outlives bounds and associated-type-outlives bounds, as illustrated by the following two examples:

struct Foo<'a, 'b: 'a> {
    x: &'a &'b u32
}

struct Bar<'a, T: Iterator> where T::Item: 'a {
    item: &'a T::Item,
}

Activity

  1. added
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    on Sep 28, 2018
  2. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    on Oct 15, 2023
  3. fmease commented on May 14, 2024

    @fmease
    Member

    We do emit explicit_outlives_requirements for the first case — Foo — (if the lint level is set to at least warn, ofc)but we still don't for the second case — Bar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lifetimesArea: Lifetimes / regionsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.L-explicit_outlives_requirementsLint: explicit_outlives_requirementsT-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