From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id 7EB23386181C for ; Thu, 1 Aug 2024 15:00:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7EB23386181C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7EB23386181C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::533 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722524456; cv=none; b=YF+vZsSeATJOdN0cwBmpUX2zt9K7673BOZlayKwBpQx30fSb7leLDNkQCOfnfOv3lM31Q+jFmulBgu3XRkvBbFRcTsqn4/C1+us35WXaNXfUyxx9IUPN2xCW+UwWfUHd32JX6/rhgy/HSFKpdko8hsRxWCIyvJnP4UKIp4O3CAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722524456; c=relaxed/simple; bh=h73lGWdTsO+/XCUapKDzXHs6Z0lQIw2tTmDLACL/6H4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=T4KVy2h3xxe7dEBZttj7diGkhQ/hYUh+4nANilwj1VOtZK6t9mX7f7iL4ww4Zso8McXBL9e3A6ZEJhS5Va2JGWfqiRP1ycisaIFfsIYbW4bYjBQjE72Q1ECNxIVLynSZv1ro6kFFCSrsM9hJGDtSvLV9GVO1b+xi1DnXx97tdvs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5a20de39cfbso9296144a12.1 for ; Thu, 01 Aug 2024 08:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1722524407; x=1723129207; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o0wEFAuunznKYRU2AP3rbHzX0vxPXYSd9ioSKoANmkU=; b=U91uwBSHRoG7DN8EfQH++xux7rh07TGC7wO/2N5IH/tzaLXny9h+BdwWetJL/9myNf ZCAOqNX4ogFKZZSUhJmmdXbcz6IbMEl/vj9Y08dz/LK0PfBTcjO7OGGD253eMkL+QNxS Swd9LGK3PooiKskkQ/jM92VDVOyIGLWfYcruFXJHDcMFMt885EUji5qC2f+QWWE+zGoG e1owatSfjZ2MBIfvluuBaCOSY7jfukMCiYP7bPV+sodZv5H10H+7yM+uS/NXmrINsilU EPC74wnUvAMAZBdYbw8mplDj1PcAxHruubU4wzZW5a9CN/W/SKNfA1+WqzHv53cBqcD8 j96A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722524407; x=1723129207; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o0wEFAuunznKYRU2AP3rbHzX0vxPXYSd9ioSKoANmkU=; b=UQvgQ0k7hIvo92IcEzNug87BmhOMUDnSmUVfzDZAPtTAgzCK5Z9cXh2kN6UVTjQ5it Hj+tSvioiB8MZdx/Q4mMOPjyhVWP9YCpsNQfxthNkib+R4P41R4bYTRLJUfWWBTmQj1s WkBUxeHjhOxbtf4nq4K7EcUU9iVu54YdUPqXJiLpgENlkEg0yoLskSFT4UJLrBG4DV54 miV7YW5KBpPbFm7J6jX7fSYnmAozwjD/T1a1Suijpb5Eg6JtQ3CwrJNVajbCG6z7STyu zlGPs5wGRgZtBJqtwBUwp/kSLaL+eROPno6uy+jnvCHySww4wQIQI+Dn42yXkUY1AnKB YBRQ== X-Gm-Message-State: AOJu0YyCS7a+1XAqDIXhVc9nlQjHCF3j8Xtifv6CDrbVb5Xa+RrtxI5C yWfWmZVw5GRzkAy5RyVlY/lDGN4CMG0ta1kf/Z6uTNOOBIEyyDVimZcXz3RWovka1JAViVk/QxL irkMP X-Google-Smtp-Source: AGHT+IGlD9fmlAapFOXuzH1f50oc+Q12rAgvnpEp0djm8B2osVCu7qC0H6f8B/p6zZdfYV3AxcBebQ== X-Received: by 2002:aa7:d591:0:b0:5a1:c40a:3a81 with SMTP id 4fb4d7f45d1cf-5b7f58ebb19mr366638a12.35.1722524406836; Thu, 01 Aug 2024 08:00:06 -0700 (PDT) Received: from platypus.lan ([2a04:cec2:9:dc84:3622:6733:ff49:ee91]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ac63590592sm10252456a12.25.2024.08.01.08.00.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Aug 2024 08:00:06 -0700 (PDT) From: Arthur Cohen To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Pierre-Emmanuel Patry Subject: [PATCH 090/125] gccrs: Remove extern block scoping Date: Thu, 1 Aug 2024 16:57:26 +0200 Message-ID: <20240801145809.366388-92-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240801145809.366388-2-arthur.cohen@embecosm.com> References: <20240801145809.366388-2-arthur.cohen@embecosm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Pierre-Emmanuel Patry 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(-) 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 &); -- 2.45.2