rust-lang / rust-lang/rust-analyzer
Inconsistent macro parsing between rust-analyzer and rustc
Nobody has claimed this yet.
- 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
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 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