Skip to content

[NLL] "so that ... will meet its required lifetime bounds" should point to RPIT, not statement #97252

Open
@jackh726

Description

@jackh726

In src/test/ui/impl-trait/type_parameters_captured.rs (and similarly in src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs) the suggestion goes from

error[E0310]: the parameter type `T` may not live long enough
  --> $DIR/type_parameters_captured.rs:11:20
   |
LL | fn foo<T>(x: T) -> impl Any + 'static {
   |                    ^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound...

to

error[E0310]: the parameter type `T` may not live long enough
  --> $DIR/type_parameters_captured.rs:13:5
   |
LL |     x
   |     ^ ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound...

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-NLLArea: Non-lexical lifetimes (NLL)A-diagnosticsArea: Messages for errors, warnings, and lintsNLL-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