]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Fix NR2 ICE in visit_attributes
authorTom Schollenberger <tss2344@g.rit.edu>
Mon, 12 May 2025 02:57:28 +0000 (22:57 -0400)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Mon, 19 May 2025 09:42:09 +0000 (09:42 +0000)
commitf870c29e2c450253b48a2c6246de48d4f5e275ea
tree14e8c4d51abb0853eb19de8616512ab04879fefa
parent2dc57afa16fe10616acb7660fa7d68d2a9666860
gccrs: Fix NR2 ICE in visit_attributes

Undefined attribute macros have no proc macro definition, which results
in a failing `rust_assert`. This changes that assert to an if statement,
that returns early if there is no proc macro definition. Fixes #3661.

gcc/rust/ChangeLog:

* resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes): rust_assert to if

gcc/testsuite/ChangeLog:

* rust/compile/issue-3661.rs: Test NR2 has expected behavior

Signed-off-by: Tom Schollenberger <tss2344@g.rit.edu>
gcc/rust/resolve/rust-early-name-resolver-2.0.cc
gcc/testsuite/rust/compile/issue-3661.rs [new file with mode: 0644]