rust-lang / rust-lang/rust-analyzer

Regression: rust-analyzer fails to expand recursively a specific macro in `rayon`

Open
#20,037 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When looking at this source file in the rayon project, expanding the multizip_impls! macro call does not fully expand, with some nest! macros remaining unexpanded. I've tried an older version where instead the expansion was complete, so this is a regression. The older version I tried was 0.3.2370-standalone, but I didn't look for the last version where that was working.

I was actually made aware of this problem by using rust-analyzer as an analysis library. As far as I know, this was last seen working at version 0.0.274 of the rust-analyzer crates, like other issues that were fixed in the meantime (https://github.com/rust-lang/rust-analyzer/issues/19873 and https://github.com/rust-lang/rust-analyzer/issues/19931, which may be related). I also have a case that seems similar to this on a private repository, but I think that if the rayon case gets fixed, it should also happen to the other case.

rust-analyzer version: 0.3.2500-standalone
rustc version: 1.87.0
editor or extension: VSCode version 0.3.2500
relevant settings: -
repository link (if public, optional): https://github.com/rayon-rs/rayon/blob/ae07384e3e0b238cea89f0c14891f351c65a5cee/src/iter/multizip.rs

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 rayon's src/iter/multizip.rs and the multizip_impls! call, reproducing the incomplete expansion with rust-analyzer 0.3.2500-standalone. Compare it with 0.3.2370-standalone and investigate the related issues #19873 and #19931; done means the nested nest! macros expand fully for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.