diff mbox series

[090/125] gccrs: Remove extern block scoping

Message ID 20240801145809.366388-92-arthur.cohen@embecosm.com
State New
Headers show
Series [001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work | expand

Commit Message

Arthur Cohen Aug. 1, 2024, 2:57 p.m. UTC
From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

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 | 12 ------------
 gcc/rust/resolve/rust-default-resolver.h  |  1 -
 2 files changed, 13 deletions(-)
diff mbox series

Patch

diff --git a/gcc/rust/resolve/rust-default-resolver.cc b/gcc/rust/resolve/rust-default-resolver.cc
index f5546181b3c..291731be5b3 100644
--- a/gcc/rust/resolve/rust-default-resolver.cc
+++ b/gcc/rust/resolve/rust-default-resolver.cc
@@ -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)
 {
diff --git a/gcc/rust/resolve/rust-default-resolver.h b/gcc/rust/resolve/rust-default-resolver.h
index a19d70bc04d..0a6427ca6a6 100644
--- a/gcc/rust/resolve/rust-default-resolver.h
+++ b/gcc/rust/resolve/rust-default-resolver.h
@@ -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 &);