]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Fix validation of constant items
authorOwen Avery <powerboat9.gamer@gmail.com>
Tue, 25 Mar 2025 22:18:21 +0000 (18:18 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 31 Mar 2025 19:07:16 +0000 (21:07 +0200)
commitf100bd794c26126c37ef7e3e9cb023a06735f429
treeaf5bb892ba0b185d9e68477b12abba78370a1007
parentbca80539a2b340ac67090d615b8901ca75818390
gccrs: Fix validation of constant items

gcc/rust/ChangeLog:

* checks/errors/rust-ast-validation.cc
(ASTValidation::visit): Allow constant items lacking expressions
if and only if they're associated with a trait definition, not a
trait implementation.

gcc/testsuite/ChangeLog:

* rust/compile/issue-3541-1.rs: New test.
* rust/compile/issue-3541-2.rs: Likewise.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/checks/errors/rust-ast-validation.cc
gcc/testsuite/rust/compile/issue-3541-1.rs [new file with mode: 0644]
gcc/testsuite/rust/compile/issue-3541-2.rs [new file with mode: 0644]