Rust-GCC / Rust-GCC/gccrs

ICE in handle_doc_item_attribute, at rust/hir/rust-ast-lower-base.cc:798

Open
#3,545 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good-first-pr
Dominant language
C++
Stars
2.9k
Forks
230
Avg merge
19h 55m
Merged PRs (30d)
67

Description

auto-reduced (treereduce-rust):

macro_rules! b {
    ($doc:expr) => {
        #[doc = $doc]
        struct B;
    };
}

b!(a!());

original:

// check-pass
macro_rules! a {
    () => { "a" }
}

macro_rules! b {
    ($doc:expr) => {
        #[doc = $doc]
         struct B;
    }
}

b!(a!());

fn main() {}

Version information:

a988708b4ba2b5a27715ea34c09ccfd3ed5143ca

Command:
crab1 -Warray-bounds -mtune=generic -march=x86-64 -O0 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -frust-incomplete-and-experimental-compiler-do-not-use

Program output

crab1: internal compiler error: in handle_doc_item_attribute, at rust/hir/rust-ast-lower-base.cc:798
0x86688d Rust::HIR::ASTLoweringBase::handle_doc_item_attribute(Rust::HIR::ItemWrapper const&, Rust::AST::Attribute const&)
	../../gcc/rust/hir/rust-ast-lower-base.cc:798
0x86688d Rust::HIR::ASTLoweringBase::handle_doc_item_attribute(Rust::HIR::ItemWrapper const&, Rust::AST::Attribute const&)
	../../gcc/rust/hir/rust-ast-lower-base.cc:786
0xdd86a6 Rust::HIR::ASTLoweringBase::handle_outer_attributes(Rust::HIR::ItemWrapper const&)
	../../gcc/rust/hir/rust-ast-lower-base.cc:774
0xde22c6 Rust::HIR::ASTLoweringItem::translate(Rust::AST::Item&)
	../../gcc/rust/hir/rust-ast-lower-item.cc:46
0xdcfd27 Rust::HIR::ASTLowering::go()
	../../gcc/rust/hir/rust-ast-lower.cc:81
0xdd0221 Rust::HIR::ASTLowering::Resolve(Rust::AST::Crate&)
	../../gcc/rust/hir/rust-ast-lower.cc:71
0xc5c218 Rust::Session::compile_crate(char const*)
	../../gcc/rust/rust-session-manager.cc:663
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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 reproducing the reduced Rust case and inspect handle_doc_item_attribute in rust/hir/rust-ast-lower-base.cc:798, using the reported stack trace as the entry point. Confirm that the reduced and original examples no longer trigger an internal compiler error and that the original check-pass case still compiles successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.