Fix lifetime error to print `'a` instead of `&'a`

This changes certain error messages about lifetimes so that they display lifetimes without an `&`.

Fixes #10291.