]> 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)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 5 Aug 2025 14:36:43 +0000 (16:36 +0200)
commit6524c0687aeeaee3c008b89dc328ee472bd1efea
tree8e4f72d416109c54e3b9f59e025227242a6a7375
parent51089b89bd480a7253a9e02c53bccf6b7ede7137
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]