rust-lang / rust-lang/rust

`macro!();` statements sometimes don't seem to include `;` in `stmt.span` (HIR)

Open
#133,845 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-diagnostics A-HIR C-bug E-needs-investigation T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

cc #133833 and #133834 in suggestions such as

#![crate_type = "lib"]

fn foo() -> String {
    let mut bar = {
        unknown_macro!();
    };
    return bar;
}

Opened while looking at #133843 to not lose the FIXME.

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 by reading the example in this issue together with #133833, #133834, and #133843, then trace how the HIR statement span is produced for the shown macro statement. Done means establishing the expected semicolon coverage and resolving the noted FIXME with appropriate validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.