]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix an issue with ForeverStack::dfs_rib
authorOwen Avery <powerboat9.gamer@gmail.com>
Sat, 1 Feb 2025 04:03:03 +0000 (23:03 -0500)
committerCohenArthur <arthur.cohen@embecosm.com>
Sun, 2 Feb 2025 18:27:53 +0000 (18:27 +0000)
gcc/rust/ChangeLog:

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

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/resolve/rust-forever-stack.hxx

index 2b628e44aead0808de15dbeef70c912a3f0ea6d7..be05f528c47bfda6867d21b29a4000207b7c0513 100644 (file)
@@ -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>