https://gcc.gnu.org/g:af2fdca5a3c9c18159a02dc8e94a95e701b66f81

commit af2fdca5a3c9c18159a02dc8e94a95e701b66f81
Author: Owen Avery <powerboat9.ga...@gmail.com>
Date:   Fri Jan 31 23:03:03 2025 -0500

    Fix an issue with ForeverStack::dfs_rib
    
    gcc/rust/ChangeLog:
    
            * resolve/rust-forever-stack.hxx
            (ForeverStack::dfs_rib): Fix const implementation.
    
    Signed-off-by: Owen Avery <powerboat9.ga...@gmail.com>

Diff:
---
 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 2b628e44aead..be05f528c47b 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>

Reply via email to