]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
nr2.0: Remove unnecessary copy of Node
authorOwen Avery <powerboat9.gamer@gmail.com>
Thu, 17 Apr 2025 23:23:12 +0000 (19:23 -0400)
committerPhilip Herron <philip.herron@embecosm.com>
Fri, 18 Apr 2025 10:39:59 +0000 (10:39 +0000)
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 e9024b564ca7ff935ecd1dbe9075af75e6f70b9c..947b72fc21f3361787a3ed07c79acba3f35d3c1a 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;