]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Fix an issue with ForeverStack::dfs_rib
authorOwen Avery <powerboat9.gamer@gmail.com>
Sat, 1 Feb 2025 04:03:03 +0000 (23:03 -0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 24 Mar 2025 12:06:58 +0000 (13:06 +0100)
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 1c83f6bda613517d59733ec4b7f6b0ea8b7860c2..d0d74217b613ad1d52da6b3276bf40ef398cfa00 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>