]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: ast: Only expand expressions and types if the kind is right
authorArthur Cohen <arthur.cohen@embecosm.com>
Mon, 29 Aug 2022 11:37:13 +0000 (13:37 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 31 Jan 2023 13:16:50 +0000 (14:16 +0100)
commit55fb35c51b2ee6b107204b6a02193cbeef077d01
treedb8b1c0c786e6899c768a6f5dd1c7595d6a13223
parent7dc41901213d32ff9962f1d54cc6291c38d0e597
gccrs: ast: Only expand expressions and types if the kind is right

gcc/rust/ChangeLog:

* ast/rust-ast.h: Add assertions and accessors for fragment nodes.
* expand/rust-attribute-visitor.cc (AttrVisitor::visit): Fix expansion
context typo when visiting `InherentImpl` items.
(AttrVisitor::maybe_expand_expr): Use new Fragment accessor to fetch
properly typed node.
(AttrVisitor::maybe_expand_type): Likewise.
* expand/rust-macro-expand.cc (transcribe_type): Emit parse errors
when trying to parse a type.
gcc/rust/ast/rust-ast.h
gcc/rust/expand/rust-attribute-visitor.cc
gcc/rust/expand/rust-macro-expand.cc