From 1995c8380836eac0edc02fbb9076fba721577ef2 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Fri, 29 Nov 2024 12:03:59 +0100 Subject: [PATCH] type-check: Remove unused capture in nr2.0 gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): Remove unused capture in lambda. --- gcc/rust/typecheck/rust-hir-type-check-type.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/rust/typecheck/rust-hir-type-check-type.cc b/gcc/rust/typecheck/rust-hir-type-check-type.cc index aaff8db99bad..2962674da62f 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-type.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-type.cc @@ -19,6 +19,7 @@ #include "rust-hir-type-check-type.h" #include "options.h" #include "optional.h" +#include "rust-hir-map.h" #include "rust-hir-trait-resolve.h" #include "rust-hir-type-check-expr.h" #include "rust-hir-path-probe.h" @@ -394,11 +395,10 @@ TypeCheckType::resolve_root_path (HIR::TypePath &path, size_t *offset, { auto nr_ctx = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); + // assign the ref_node_id if we've found something nr_ctx.lookup (path.get_mappings ().get_nodeid ()) - .map ([&ref_node_id, &path] (NodeId resolved) { - ref_node_id = resolved; - }); + .map ([&ref_node_id] (NodeId resolved) { ref_node_id = resolved; }); } else if (!resolver->lookup_resolved_name (ast_node_id, &ref_node_id)) resolver->lookup_resolved_type (ast_node_id, &ref_node_id);