rust-lang / rust-lang/rust-analyzer

[feat] Optional Inlay Hint for Too Many Implicit Returns in One Function

Open
#18,924 15 comments 0 reactions 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

I have previewed the history of issues, and noticed that the optional inlay hint for the implicit returns would be useful when there are too many returns in one function.
For example, in crates\hir-def\src\body\lower\asm.rs, the lower_inline_asm function has too many returns for readers to distinguish the difference.
I also see the similar issues in the history, e.g. #9969, #4691.
I think adding inlay hint for the implicit return would be a useful option.

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

Start by reviewing the example in crates\hir-def\src\body\lower\asm.rs, especially the lower_inline_asm function, to understand the implicit-return case being requested. Read the related issue history in #9969 and #4691. Done means an optional inlay hint exists for functions with too many implicit returns, with the behavior and threshold defined.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.