aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-ast-resolve-expr.h
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-10-25 13:26:21 +0000
committerGitHub <noreply@github.com>2021-10-25 13:26:21 +0000
commitaefdb4d0365ce9f010be58afee74f81a1777f29f (patch)
tree2559822b214026dff3e706f80bec551bfde33e6c /gcc/rust/resolve/rust-ast-resolve-expr.h
parent868d3125d326a6800376411fb6699d984cfa7101 (diff)
parent1d3a36276a07a7472ed39499a2c9ddce37146d93 (diff)
downloadgcc-aefdb4d0365ce9f010be58afee74f81a1777f29f.zip
gcc-aefdb4d0365ce9f010be58afee74f81a1777f29f.tar.gz
gcc-aefdb4d0365ce9f010be58afee74f81a1777f29f.tar.bz2
Merge #767
767: gccrs: StructExprStructFields: remove `iterate` method r=philberty a=mathstuf This provides a getter for the set of fields in a struct expression rather than a visitor with a callback which is more complicated for callers, especially static analysis. Signed-off-by: Ben Boeckel <mathstuf@gmail.com> Fixes: #721 Co-authored-by: Ben Boeckel <mathstuf@gmail.com>
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-expr.h')
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-expr.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.h b/gcc/rust/resolve/rust-ast-resolve-expr.h
index 2aa7afd..48906f5 100644
--- a/gcc/rust/resolve/rust-ast-resolve-expr.h
+++ b/gcc/rust/resolve/rust-ast-resolve-expr.h
@@ -269,11 +269,12 @@ public:
struct_expr.get_node_id ());
}
- struct_expr.iterate (
- [&] (AST::StructExprField *struct_field) mutable -> bool {
- ResolveStructExprField::go (struct_field, struct_expr.get_node_id ());
- return true;
- });
+ auto const &struct_fields = struct_expr.get_fields ();
+ for (auto &struct_field : struct_fields)
+ {
+ ResolveStructExprField::go (struct_field.get (),
+ struct_expr.get_node_id ());
+ }
}
void visit (AST::GroupedExpr &expr) override