aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-path.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/ast/rust-path.h')
-rw-r--r--gcc/rust/ast/rust-path.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h
index 6ccd3a0..8992993 100644
--- a/gcc/rust/ast/rust-path.h
+++ b/gcc/rust/ast/rust-path.h
@@ -1029,6 +1029,15 @@ public:
}
Location get_locus () const override final { return locus; }
+
+ void iterate_segments (std::function<bool (TypePathSegment *)> cb)
+ {
+ for (auto it = segments.begin (); it != segments.end (); it++)
+ {
+ if (!cb ((*it).get ()))
+ return;
+ }
+ }
};
} // namespace AST
} // namespace Rust