]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Remove unused copy
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 21 Aug 2025 10:47:05 +0000 (12:47 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 30 Oct 2025 19:58:42 +0000 (20:58 +0100)
Variable path was copying the path but not using one of the copies.

gcc/rust/ChangeLog:

* resolve/rust-ast-resolve-stmt.cc (ResolveStmt::visit): Remove
unused copy.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/resolve/rust-ast-resolve-stmt.cc

index bfba302d29d1cf4fed9dbc6f066eb7fd00ab055e..2438cc48af42939c4e09b2e2d17a81d144726355 100644 (file)
@@ -61,12 +61,11 @@ ResolveStmt::visit (AST::StaticItem &var)
 {
   auto decl = CanonicalPath::new_seg (var.get_node_id (),
                                      var.get_identifier ().as_string ());
-  auto path = decl;
   auto cpath = canonical_prefix.append (decl);
   mappings.insert_canonical_path (var.get_node_id (), cpath);
 
   resolver->get_name_scope ().insert (
-    path, var.get_node_id (), var.get_locus (), false, Rib::ItemType::Static,
+    decl, var.get_node_id (), var.get_locus (), false, Rib::ItemType::Static,
     [&] (const CanonicalPath &, NodeId, location_t locus) -> void {
       rich_location r (line_table, var.get_locus ());
       r.add_range (locus);
@@ -74,7 +73,7 @@ ResolveStmt::visit (AST::StaticItem &var)
     });
 
   ResolveType::go (var.get_type ());
-  ResolveExpr::go (var.get_expr (), path, cpath);
+  ResolveExpr::go (var.get_expr (), decl, cpath);
 }
 
 } // namespace Resolver