]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: nr2.0: Remove unnecessary copy of Node
authorOwen Avery <powerboat9.gamer@gmail.com>
Thu, 17 Apr 2025 23:23:12 +0000 (19:23 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 28 Apr 2025 14:18:54 +0000 (16:18 +0200)
gcc/rust/ChangeLog:

* resolve/rust-forever-stack.hxx
(ForeverStack::resolve_path): Pass instance of Node to lambda by
reference instead of by value.

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

index 993e2d4fd2abba30be1bfcbf1c806e8fbb7603ee..73c795668d9a487c131f1672e5a1af6e3c85c9d5 100644 (file)
@@ -676,7 +676,7 @@ ForeverStack<N>::resolve_path (
                                     insert_segment_resolution);
          })
        .and_then ([this, &segments, &insert_segment_resolution] (
-                    Node final_node) -> tl::optional<Rib::Definition> {
+                    Node &final_node) -> tl::optional<Rib::Definition> {
          // leave resolution within impl blocks to type checker
          if (final_node.rib.kind == Rib::Kind::TraitOrImpl)
            return tl::nullopt;