rust-lang / rust-lang/rust-analyzer
Tooltips on function names should not show `const fn` if using the fn in const would require a feature not active in the crate
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Many stdlib functions, such as f32::from_be_bytes, are const fn only with a specific feature enabled.
The tooltip for the function's docs and info should not show the fn as being const fn if the required compiler feature isn't set within the crate.
rust-analyzer version: rust-analyzer version: 0.3.1740-standalone (255eed40c 2023-11-17)
rustc version: rustc 1.75.0-nightly (e5cfc5547 2023-10-28)
relevant settings: -
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
Begin at rust-analyzer's tooltip path for function documentation and info, then trace how constness and crate feature activation are determined. Check a standard-library function such as f32::from_be_bytes with the required feature disabled and enabled; done means the tooltip shows const fn only when the feature is active.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100