rust-lang / rust-lang/rust-analyzer
Overwrite return type even if it is already specified
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Currently, infer_function_return_type adds the return type only if the return type is missing. It would be nice if we have a choice to overwrite the return type based on the current tail expression, even if it is already specified (but it does not match).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating infer_function_return_type and read how it handles an existing return type. Determine where the requested overwrite choice should be exposed, then add coverage for a specified return type that differs from the current tail expression and verify the existing missing-type behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100