You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
only do the elided-lifetimes-in-paths lint on type paths
Instead of linting for invisible lifetimes during (a callee of)
`visit_path` (in the `LifetimeContext` visitor), we do it in the
`hir::TyPath` branch of `visit_ty`. This fixes a false positive where
we were suggesting `<'_>` on the struct name of a struct construction
expression. (Applying the suggestion would result in a parse error.)
Also, it seems better for the primary lint span (as distinguished from
the zero-width suggestion span where we propose the insertion of
anonymous lifetimes) to cover the entire path including any
angle-bracketed type parameters, rather than just the last path-name
segment. That is: we should highlight all of `Ref<T>` when we suggest
replacing it with `Ref<'_, T>`, rather than just highlighting the
`Ref`.
(Interestingly, this false positive didn't happen for tuple structs
like the one we already had in our UI test, probably because of
something something value vs. type namespace &c. that the present
author doesn't understand.)
This is in the matter of issue no. 52041.
0 commit comments