rust-lang / rust-lang/rust-analyzer

Inlay hint for `elided-lifetimes-in-paths`

Open
#18,007 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-inlay-hints C-feature
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

Rust proposes a warning for elided-lifetimes-in-paths, because "Elided lifetime parameters can make it difficult to see at a glance that borrowing is occurring. This lint ensures that lifetime parameters are always explicitly stated, even if it is the '_ placeholder lifetime."

Enabling this disabled-by-default warning makes sure that the code is always readable on that regard, but it looks like having that as an inlay hint instead of enabling the lint to enforce on each developer that they set them, may give the readability benefit without the downside of having to actually write them and/or add/remove them everywhere when adding/removing lifetimes to the struct.

Does that look like something that would be reasonable to add to rust-analyzer?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no file, test, or entry point. Start by reviewing rust-analyzer's existing inlay-hint behavior alongside the elided-lifetimes-in-paths lint documentation. Done should mean an agreed design and an inlay hint that provides the readability benefit without requiring the lint to be enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.