diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-08-20 12:34:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-20 12:34:35 +0000 |
commit | 79754bd20bdfa64a4ce91e5b4a65154c313b2d83 (patch) | |
tree | 47dc551f706c4015c017a299a4054cb7db460857 /gcc/rust/util/rust-canonical-path.h | |
parent | 387f73626ae0e04c3f81d71d4de6780a4caad052 (diff) | |
parent | 048261647afd1a08f681b78c90c58a9baaeef76d (diff) | |
download | gcc-79754bd20bdfa64a4ce91e5b4a65154c313b2d83.zip gcc-79754bd20bdfa64a4ce91e5b4a65154c313b2d83.tar.gz gcc-79754bd20bdfa64a4ce91e5b4a65154c313b2d83.tar.bz2 |
Merge #626
626: Optional trait items r=philberty a=philberty
Optional trait items like function may contain associated types. These
are dependant on the associated impl block for this type in order to
correctly propagate the correct types for the associated trait item during
type checking and compilation.
Fixes #542
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/util/rust-canonical-path.h')
-rw-r--r-- | gcc/rust/util/rust-canonical-path.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-canonical-path.h b/gcc/rust/util/rust-canonical-path.h index d6ba90d..b5f8dd7 100644 --- a/gcc/rust/util/rust-canonical-path.h +++ b/gcc/rust/util/rust-canonical-path.h @@ -110,6 +110,17 @@ public: } } + void iterate_segs (std::function<bool (const CanonicalPath &)> cb) const + { + for (auto &seg : segs) + { + std::vector<std::pair<NodeId, std::string>> buf; + buf.push_back ({seg.first, seg.second}); + if (!cb (CanonicalPath (buf))) + return; + } + } + size_t size () const { return segs.size (); } NodeId get_id () const |