From: Arthur Cohen <[email protected]>

gcc/rust/ChangeLog:

        * resolve/rust-forever-stack.h: Add depth parameter to function.
        * resolve/rust-forever-stack.hxx: Likewise and use it.
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.


Commit on github: 
https://github.com/Rust-GCC/gccrs/commit/055467b59016b87e1652eb5d3190389bd2f72af5

The commit has been mentioned in the following pull-request(s):
 - https://github.com/Rust-GCC/gccrs/pull/4343

 gcc/rust/resolve/rust-forever-stack.h   | 2 +-
 gcc/rust/resolve/rust-forever-stack.hxx | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/rust/resolve/rust-forever-stack.h 
b/gcc/rust/resolve/rust-forever-stack.h
index abb2ca318..fb265582a 100644
--- a/gcc/rust/resolve/rust-forever-stack.h
+++ b/gcc/rust/resolve/rust-forever-stack.h
@@ -787,7 +787,7 @@ private:
   void stream_rib (std::stringstream &stream, const Rib &rib,
                   const std::string &next, const std::string &next_next) const;
   void stream_node (std::stringstream &stream, unsigned indentation,
-                   const Node &node) const;
+                   const Node &node, unsigned depth = 0) const;
 
   /* Helper types and functions for `resolve_path` */
 
diff --git a/gcc/rust/resolve/rust-forever-stack.hxx 
b/gcc/rust/resolve/rust-forever-stack.hxx
index 1ba9686fe..cd13af015 100644
--- a/gcc/rust/resolve/rust-forever-stack.hxx
+++ b/gcc/rust/resolve/rust-forever-stack.hxx
@@ -963,7 +963,8 @@ ForeverStack<N>::stream_rib (std::stringstream &stream, 
const Rib &rib,
 template <Namespace N>
 void
 ForeverStack<N>::stream_node (std::stringstream &stream, unsigned indentation,
-                             const ForeverStack<N>::Node &node) const
+                             const ForeverStack<N>::Node &node,
+                             unsigned depth) const
 {
   auto indent = std::string (indentation, ' ');
   auto next = std::string (indentation + 4, ' ');
@@ -982,12 +983,12 @@ ForeverStack<N>::stream_node (std::stringstream &stream, 
unsigned indentation,
     {
       auto link = kv.first;
       auto child = kv.second;
-      stream << indent << "Link (" << link.id << ", "
+      stream << indent << "Link " << depth << " (" << link.id << ", "
             << (link.path.has_value () ? link.path.value ().as_string ()
                                        : "<anon>")
             << "):\n";
 
-      stream_node (stream, indentation + 4, child);
+      stream_node (stream, indentation + 4, child, depth + 1);
 
       stream << '\n';
     }

base-commit: 13d989d6723fd5489ca1df4cd91d985816903bd4
-- 
2.52.0

Reply via email to