Skip to content

[NLL] "that is required by this bound" note missing #97253

Open
@jackh726

Description

@jackh726

In src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.rs and src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs we lose a note:

before

error[E0309]: the associated type `<T as MyTrait<'a>>::Output` may not live long enough
  --> $DIR/projection-where-clause-env-wrong-lifetime.rs:14:5
   |
LL |     bar::<<T as MyTrait<'a>>::Output>()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider adding an explicit lifetime bound `<T as MyTrait<'a>>::Output: 'a`...
   = note: ...so that the type `<T as MyTrait<'a>>::Output` will meet its required lifetime bounds...
note: ...that is required by this bound
  --> $DIR/projection-where-clause-env-wrong-lifetime.rs:20:8
   |
LL |     T: 'a,
   |        ^^

after

error[E0309]: the associated type `<T as MyTrait<'_>>::Output` may not live long enough
  --> $DIR/projection-where-clause-env-wrong-lifetime.rs:14:5
   |
LL |     bar::<<T as MyTrait<'a>>::Output>()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider adding an explicit lifetime bound `<T as MyTrait<'_>>::Output: 'a`...
   = note: ...so that the type `<T as MyTrait<'_>>::Output` will meet its required lifetime bounds

Probably related, but the error used '_ instead of 'a

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-NLLArea: Non-lexical lifetimes (NLL)A-diagnosticsArea: Messages for errors, warnings, and lintsD-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.NLL-diagnosticsWorking towards the "diagnostic parity" goalT-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