]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Remove extern block scoping
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 6 Feb 2024 14:10:44 +0000 (15:10 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 1 Aug 2024 14:52:27 +0000 (16:52 +0200)
Remove extern block scoping visit function, use the default visitor visit
function instead. We do not need scoping for extern block as their
element shall be visible from the extern block scope.

gcc/rust/ChangeLog:

* resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove
visitor implementation and scoping.
* resolve/rust-default-resolver.h: Remove function prototype.

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

index f5546181b3c6e81552b005723f70c15be07bb53a..291731be5b36bee957d749e401df8035a945e5e6 100644 (file)
@@ -133,18 +133,6 @@ DefaultResolver::visit (AST::TraitImpl &impl)
   ctx.scoped (Rib::Kind::TraitOrImpl, impl.get_node_id (), inner_fn);
 }
 
-void
-DefaultResolver::visit (AST::ExternBlock &block)
-{
-  auto inner_fn = [this, &block] () {
-    for (auto &item : block.get_extern_items ())
-      item->accept_vis (*this);
-  };
-
-  ctx.scoped (Rib::Kind::Normal /* FIXME: Correct? */, block.get_node_id (),
-             inner_fn);
-}
-
 void
 DefaultResolver::visit (AST::StructStruct &type)
 {
index a19d70bc04d98c5c935644255e763ca50993d907..0a6427ca6a616380b8b102902b2821600d1c59e7 100644 (file)
@@ -49,7 +49,6 @@ public:
   void visit (AST::Trait &);
   void visit (AST::InherentImpl &);
   void visit (AST::TraitImpl &);
-  void visit (AST::ExternBlock &);
 
   // type dec nodes, which visit their fields or variants by default
   void visit (AST::StructStruct &);