]> git.ipfire.org Git - thirdparty/gcc.git/commit
Unify storage of associated items in SingleASTNode
authorOwen Avery <powerboat9.gamer@gmail.com>
Wed, 20 Dec 2023 07:30:20 +0000 (02:30 -0500)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Thu, 18 Jan 2024 16:30:39 +0000 (16:30 +0000)
commit43bb4971606dd08ca14ab61a0e232ea58c79e7fb
treea84b38c690a60fc14cd13ebe480a0e2dc2b38215
parent972a4f0205b880877744ff78d1a43215fe8f283f
Unify storage of associated items in SingleASTNode

gcc/rust/ChangeLog:

* ast/rust-ast-fragment.cc
(Fragment::assert_single_fragment): Update.

* ast/rust-ast.h
(class TraitImplItem): Move definition before that of TraitItem.
(class TraitItem):
Inherit from TraitImplItem instead of AssociatedItem.

(class SingleASTNode): Unify handling of associated items.
(SingleASTNode::take_assoc_item): Move from...
(SingleASTNode::take_impl_item): ...here, but leave stub calling
take_assoc_item behind.
(SingleASTNode::take_trait_item):
Cast associated item to TraitItem.
(SingleASTNode::take_trait_impl_item):
Cast associated item to TraitImplItem.

* ast/rust-ast.cc
(SingleASTNode::SingleASTNode):
Unify handling of associated items.
(SingleASTNode::operator=): Likewise.
(SingleASTNode::accept_vis): Likewise.
(SingleASTNode::is_error): Likewise.
(SingleASTNode::as_string): Likewise.

* ast/rust-item.h
(class Function): Remove direct inheritence from AssociatedItem.
(class ConstantItem): Likewise.
* ast/rust-macro.h
(class MacroInvocation):
Remove direct inheritence from AssociatedItem and TraitImplItem.
gcc/rust/ast/rust-ast-fragment.cc
gcc/rust/ast/rust-ast.cc
gcc/rust/ast/rust-ast.h
gcc/rust/ast/rust-item.h
gcc/rust/ast/rust-macro.h