Skip to content

Commit 6f99437

Browse files
committed
Remove unused copy
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>
1 parent 649058f commit 6f99437

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

gcc/rust/resolve/rust-ast-resolve-stmt.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,19 @@ ResolveStmt::visit (AST::StaticItem &var)
6161
{
6262
auto decl = CanonicalPath::new_seg (var.get_node_id (),
6363
var.get_identifier ().as_string ());
64-
auto path = decl;
6564
auto cpath = canonical_prefix.append (decl);
6665
mappings.insert_canonical_path (var.get_node_id (), cpath);
6766

6867
resolver->get_name_scope ().insert (
69-
path, var.get_node_id (), var.get_locus (), false, Rib::ItemType::Static,
68+
decl, var.get_node_id (), var.get_locus (), false, Rib::ItemType::Static,
7069
[&] (const CanonicalPath &, NodeId, location_t locus) -> void {
7170
rich_location r (line_table, var.get_locus ());
7271
r.add_range (locus);
7372
redefined_error (r);
7473
});
7574

7675
ResolveType::go (var.get_type ());
77-
ResolveExpr::go (var.get_expr (), path, cpath);
76+
ResolveExpr::go (var.get_expr (), decl, cpath);
7877
}
7978

8079
} // namespace Resolver

0 commit comments

Comments
 (0)