aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend
diff options
context:
space:
mode:
authorOwen Avery <powerboat9.gamer@gmail.com>2024-10-21 18:02:48 -0400
committerArthur Cohen <arthur.cohen@embecosm.com>2025-03-24 13:07:00 +0100
commit9a97fa81958aa76ce55d3e34cd2692474eac0174 (patch)
tree7de44f2850af4c3f9319a70a35139e264c2efcbc /gcc/rust/backend
parent50c9ea9121629fc415700aa0b343b87247cc2a89 (diff)
downloadgcc-9a97fa81958aa76ce55d3e34cd2692474eac0174.zip
gcc-9a97fa81958aa76ce55d3e34cd2692474eac0174.tar.gz
gcc-9a97fa81958aa76ce55d3e34cd2692474eac0174.tar.bz2
gccrs: nr2.0: Remove accidental copies of resolver
gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::generate_closure_function): Take NameResolutionContext by reference instead of by value. * backend/rust-compile-item.cc (CompileItem::visit): Likewise. * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): Likewise. * checks/lints/rust-lint-marklive.cc (MarkLive::find_ref_node_id): Likewise. * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise. * typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItem::visit): Likewise. * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Likewise. * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): Likewise. * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): Likewise. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/backend')
-rw-r--r--gcc/rust/backend/rust-compile-expr.cc2
-rw-r--r--gcc/rust/backend/rust-compile-item.cc6
-rw-r--r--gcc/rust/backend/rust-compile-resolve-path.cc2
3 files changed, 5 insertions, 5 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc
index 29cc883..48713e7 100644
--- a/gcc/rust/backend/rust-compile-expr.cc
+++ b/gcc/rust/backend/rust-compile-expr.cc
@@ -2453,7 +2453,7 @@ CompileExpr::generate_closure_function (HIR::ClosureExpr &expr,
auto body_mappings = function_body.get_mappings ();
if (flag_name_resolution_2_0)
{
- auto nr_ctx
+ auto &nr_ctx
= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
auto candidate = nr_ctx.values.to_rib (body_mappings.get_nodeid ());
diff --git a/gcc/rust/backend/rust-compile-item.cc b/gcc/rust/backend/rust-compile-item.cc
index 52cd59f..39d4b9e 100644
--- a/gcc/rust/backend/rust-compile-item.cc
+++ b/gcc/rust/backend/rust-compile-item.cc
@@ -52,7 +52,7 @@ CompileItem::visit (HIR::StaticItem &var)
if (flag_name_resolution_2_0)
{
- auto nr_ctx
+ auto &nr_ctx
= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
canonical_path
@@ -119,7 +119,7 @@ CompileItem::visit (HIR::ConstantItem &constant)
if (flag_name_resolution_2_0)
{
- auto nr_ctx
+ auto &nr_ctx
= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
canonical_path
@@ -192,7 +192,7 @@ CompileItem::visit (HIR::Function &function)
if (flag_name_resolution_2_0)
{
- auto nr_ctx
+ auto &nr_ctx
= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
auto path = nr_ctx.values.to_canonical_path (
diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc
index 103f0cb..fbf9a3d 100644
--- a/gcc/rust/backend/rust-compile-resolve-path.cc
+++ b/gcc/rust/backend/rust-compile-resolve-path.cc
@@ -212,7 +212,7 @@ ResolvePathRef::resolve (const HIR::PathIdentSegment &final_segment,
NodeId ref_node_id = UNKNOWN_NODEID;
if (flag_name_resolution_2_0)
{
- auto nr_ctx
+ auto &nr_ctx
= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
auto resolved = nr_ctx.lookup (mappings.get_nodeid ());