rust-lang / rust-lang/rust-analyzer

Inconsistent macro parsing between rust-analyzer and rustc

Open
#22,268 2 comments 2 reactions 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

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)

rustc version: 0.4.2885-standalone

editor or extension: VSCode

relevant settings: None

repository link (if public, optional): https://github.com/bevyengine/bevy/issues/24050. See https://github.com/alice-i-cecile/bevy/tree/negative-captain for a branch with a ready-made reproduction.

code snippet to reproduce:

use bevy::prelude::*;

        #[derive(Component, FromTemplate, PartialEq, Eq, Debug)]
        struct Foo {
            x: i32,
        }

        fn scene() -> impl Scene {
            bsn! {
                Foo { x: -42 }
            }
        }

Note: requires the currently unreleased Bevy 0.19 or later!

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 reproduction in the linked Bevy issue and the negative-captain branch, using the supplied rust-analyzer and rustc versions. Compare how each parses the bsn! macro example involving the negative literal. Done means the inconsistent parsing behavior is identified and rust-analyzer matches rustc for this reproduction.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.