Skip to content

E310 uses weird terminology #36700

Closed
Closed
@hanna-kruppe

Description

@hanna-kruppe

For context, the message is, in the case of a type parameter T missing a lifetime bound:

error: the parameter type T may not live long enough

The suggestion that follows (adding a lifetime bound to T) is fine, but I've just seen someone confused by the wording of the actual error message. Irrespective of any misconceptions or lack of knowledge that might have factored in that specific person's confusion, this message does seem to use very strange terminology. Types, as opposed to values, don't really live (it's occasionally convenient to make puns about this, but in this case it hurts), and it's not really a question of how long a value of type T lives but rather of lifetime parameters contained in T. Also, "parameter type" looks odd — "type parameter" seems much more common.

I'd suggest something like

error: values of type T may contain data that does not live long enough

The exact wording is just a straw man, I don't think it's optimal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.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