https://gcc.gnu.org/g:44b05e9a822763f8a9427df426401e425fdd0c2a
commit r17-6263-g44b05e9a822763f8a9427df426401e425fdd0c2a Author: Pierre-Emmanuel Patry <[email protected]> Date: Sun Nov 8 03:40:30 2026 +0100 gccrs: Use RawPath for ResolutionPath input Replace ResolutionPath input with a Rawpath instead of a split vector/ flag couple. gcc/rust/ChangeLog: * resolve/rust-forever-stack.h: Use RawPath as ResolutionPath input. * resolve/rust-name-resolution-context.h: Change call site. Signed-off-by: Pierre-Emmanuel Patry <[email protected]> Diff: --- gcc/rust/resolve/rust-forever-stack.h | 9 ++++----- gcc/rust/resolve/rust-name-resolution-context.h | 6 ++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/gcc/rust/resolve/rust-forever-stack.h b/gcc/rust/resolve/rust-forever-stack.h index 70ea85be511c..5a0cd22b20af 100644 --- a/gcc/rust/resolve/rust-forever-stack.h +++ b/gcc/rust/resolve/rust-forever-stack.h @@ -418,13 +418,12 @@ class ResolutionPath : public RawPath<ResolutionPathSegment> { public: template <typename T> - ResolutionPath (const std::vector<T> &segments_in, - bool opening_scope_resolution, NodeId node_id) - : RawPath ({}, opening_scope_resolution), node_id (node_id) + ResolutionPath (const RawPath<T> &path, NodeId node_id) + : RawPath ({}, path.has_opening_scope_resolution ()), node_id (node_id) { segments.clear (); - segments.reserve (segments_in.size ()); - for (auto &outer_seg : segments_in) + segments.reserve (path.get_segments ().size ()); + for (auto &outer_seg : path.get_segments ()) { if (auto lang_item = unwrap_segment_get_lang_item (outer_seg)) { diff --git a/gcc/rust/resolve/rust-name-resolution-context.h b/gcc/rust/resolve/rust-name-resolution-context.h index 1564a83cbeb1..697dfd823fa4 100644 --- a/gcc/rust/resolve/rust-name-resolution-context.h +++ b/gcc/rust/resolve/rust-name-resolution-context.h @@ -688,8 +688,7 @@ public: template <typename S> void set_path (const RawPath<S> &new_path, NodeId node_id) { - path = ResolutionPath (new_path.get_segments (), - new_path.has_opening_scope_resolution (), node_id); + path = ResolutionPath (new_path, node_id); mode = ResolutionMode::Normal; if (new_path.has_opening_scope_resolution ()) { @@ -705,8 +704,7 @@ public: void set_path (const RawPath<S> &new_path, NodeId node_id, ResolutionMode mode) { - path = ResolutionPath (new_path.get_segments (), - new_path.has_opening_scope_resolution (), node_id); + path = ResolutionPath (new_path, node_id); this->mode = mode; has_path_set = true; }
