-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
let tmp = [0];
let _this_has_a_lifetime = tmp.iter();When hovering _this_has_a_lifetime, RA shows:
let _this_has_a_lifetime: Iter<i32>
But this is not the full type. Crucially, this isn't a self-contained type, and it is tied a temporary loan. Hiding lifetimes in this case is very unhelpful, because I have to go to the documentation to see if the type has any lifetime arguments.
I'd like this to be displayed as:
let _this_has_a_lifetime: Iter<'_, i32>
or showing the form used at the point of definition of the Iter.
Lack of lifetime information is especially problematic when working with an unfamiliar library, because the code needs to be structured differently if the types are borrowing (to avoid self-referential types etc.), and the types will need to be annotated with lifetime arguments sooner or later. Without RA's help, I only learn about the lifetimes later when getting borrow checker errors.
