From 4f17f2dd454f68a8ed2e76073590d195d13194b0 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Tue, 6 Feb 2024 15:10:44 +0100 Subject: gccrs: Remove extern block scoping 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 --- gcc/rust/resolve/rust-default-resolver.cc | 12 ------------ gcc/rust/resolve/rust-default-resolver.h | 1 - 2 files changed, 13 deletions(-) (limited to 'gcc') diff --git a/gcc/rust/resolve/rust-default-resolver.cc b/gcc/rust/resolve/rust-default-resolver.cc index f554618..291731b 100644 --- a/gcc/rust/resolve/rust-default-resolver.cc +++ b/gcc/rust/resolve/rust-default-resolver.cc @@ -134,18 +134,6 @@ DefaultResolver::visit (AST::TraitImpl &impl) } 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) { // do we need to scope anything here? no, right? diff --git a/gcc/rust/resolve/rust-default-resolver.h b/gcc/rust/resolve/rust-default-resolver.h index a19d70b..0a6427c 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 &); -- cgit v1.1