aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-ast-resolve-item.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2020-12-30 22:13:41 +0000
committerPhilip Herron <herron.philip@googlemail.com>2021-01-06 10:01:17 +0000
commit36ebe9a0380694c8517536eb37c7134f1323a30b (patch)
tree06901ff25aa5ea093184e0713bd0363735408959 /gcc/rust/resolve/rust-ast-resolve-item.h
parent467141184aa274126ff7e2a41d08bb621b7a3fdf (diff)
downloadgcc-36ebe9a0380694c8517536eb37c7134f1323a30b.zip
gcc-36ebe9a0380694c8517536eb37c7134f1323a30b.tar.gz
gcc-36ebe9a0380694c8517536eb37c7134f1323a30b.tar.bz2
This brings structs back in post HIR changes. It supports structs
where no base struct is referenced and the constructor is in order.
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-item.h')
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-item.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-item.h b/gcc/rust/resolve/rust-ast-resolve-item.h
index eca52dc..523f985 100644
--- a/gcc/rust/resolve/rust-ast-resolve-item.h
+++ b/gcc/rust/resolve/rust-ast-resolve-item.h
@@ -39,6 +39,14 @@ public:
~ResolveItem () {}
+ void visit (AST::StructStruct &struct_decl)
+ {
+ struct_decl.iterate ([&] (AST::StructField &field) mutable -> bool {
+ ResolveType::go (field.get_field_type ().get (), field.get_node_id ());
+ return true;
+ });
+ }
+
void visit (AST::ConstantItem &constant)
{
ResolveType::go (constant.get_type ().get (), constant.get_node_id ());