From: Owen Avery <powerboat9.ga...@gmail.com>

gcc/rust/ChangeLog:

        * resolve/rust-forever-stack.hxx
        (ForeverStack::dfs_rib): Fix const implementation.

Signed-off-by: Owen Avery <powerboat9.ga...@gmail.com>
---
 gcc/rust/resolve/rust-forever-stack.hxx | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gcc/rust/resolve/rust-forever-stack.hxx 
b/gcc/rust/resolve/rust-forever-stack.hxx
index 1c83f6bda61..d0d74217b61 100644
--- a/gcc/rust/resolve/rust-forever-stack.hxx
+++ b/gcc/rust/resolve/rust-forever-stack.hxx
@@ -638,9 +638,8 @@ tl::optional<const Rib &>
 ForeverStack<N>::dfs_rib (const ForeverStack<N>::Node &starting_point,
                          NodeId to_find) const
 {
-  return dfs_node (starting_point, to_find).map ([] (Node &x) -> Rib & {
-    return x.rib;
-  });
+  return dfs_node (starting_point, to_find)
+    .map ([] (const Node &x) -> const Rib & { return x.rib; });
 }
 
 template <Namespace N>
-- 
2.45.2

Reply via email to