Description
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.