rust-lang / rust-lang/rust-analyzer

Function named "async" in non-2018 crate causes error

Open
#7,008 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-parser S-actionable
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

I'm working on a PR for https://github.com/BurntSushi/ripgrep and rust analyser is showing Syntax Error: expected a name
for this function. I think the function name being a reserved keyword (async) in post 2018 Rust is causing this - however "async" is a legal item name in pre-2018 Rust - https://doc.rust-lang.org/reference/keywords.html

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 with the function at crates/cli/src/process.rs line 234 in the linked ripgrep revision, using its pre-2018 crate context to reproduce the syntax error. Trace how rust-analyzer parses the reserved keyword as an item name, and verify that the function no longer produces a syntax error in the reported context.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.