From patchwork Tue Jan 30 12:06:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 1892826 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=embecosm.com header.i=@embecosm.com header.a=rsa-sha256 header.s=google header.b=cfmyxD/8; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TPPSr3Hpyz23dQ for ; Tue, 30 Jan 2024 23:22:52 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 66FE63858017 for ; Tue, 30 Jan 2024 12:22:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id DC883385800D for ; Tue, 30 Jan 2024 12:10:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC883385800D 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 DC883385800D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616660; cv=none; b=lRvIfH3SDAgSj7dC0g8cj0qfI0smhkGBpCxDadn6KelCQJYrTLgJxh13JYpWgjVhG1jZ23Ol/+4yv1e7tjI4+Ef89OEaZkDob3J2iQhMFiKR9+aD1peVRALnIR8lfsxCK/CfQZGHsnmEAssz1y5Uu3jNDqpagVlOIWZe+vLVLXM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616660; c=relaxed/simple; bh=r7Xw6S9uiZHpaFXwHJMOWWkHAsI/4DoCI7SPFiU7adk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=AX1uIaPtCPVUPvqGZIK70PnVu3khYrSZPwQb447PPer9g8Ow1aUaDw4orul3Pbd5xX42PvX2GGQE9StEw88mHri6+kgh/3ufMW4Tnjt+//z2dNk1KWHiqcLwQSS6kvNcL0A9Cfw+jBxceud4ICfS4+VeFf0VhqJp3t6Dn2D4U2s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-33aeb088324so1539280f8f.2 for ; Tue, 30 Jan 2024 04:10:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1706616655; x=1707221455; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=UFUj8oXvszxBtgA1dFNDIG0cvROUwhGsgQytSRWEMVs=; b=cfmyxD/8WAaQvsx3ejiU2hKlSLBcUoHK0JRSXFuIjs77Z5mcP//d1f6zcMGMpm2wyX pmn8pd3EldgZXmaVFRjw/LAayjHIQLxSjcHw0Cbltn9KntC6X3W7pEr0f4eplVPpzCTh ENYNgNDIV62Xu61miPCoONWMQ7bLtKA9094jKWFK6kQML5oifSpivqX4FDcjYHTfUgmy Ke73Yti1OAmCqyEPNJNKhwYHDhumYkvJb9E35bHGC/8uiff4WNppnM37/q7oJzi4fAKr Wy9cQtnLPEShnYvipjbKExRGbW2jG2COF0PeCd+erXKPSgxriCduc7Kj6KuAzXIA/uZo O/QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706616655; x=1707221455; h=content-transfer-encoding:mime-version:reply-to: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=UFUj8oXvszxBtgA1dFNDIG0cvROUwhGsgQytSRWEMVs=; b=AG1L3H+Vw5UJvNhUvLwlr5o4z9QjlAXwk/4NOjq7mhnBKury5PABppHrvUVoisAOos SGWpXeuFq1FFy+jb+sFK714RGnAxY6bcug5PNVe4VsmhRLhQN6KmUJQ7TNtW31VVElvl BJU1qVuQYriG8itA4AQMyC+ypUYoHBCRqP3mrbwvWq681tBksH12OtozGjg9OYhyOmWc 2/sfYnS5iW7sVX8v+o+367qh81TdvDlfSI0q2sYUJPXBb0HZ0e0NnmvWstmfdJq5mdtU eVuWNpxwFdPAeJIqs6zvUZwjDoNd5EyLLYVIF7xbHIICqEhw6Kn81WGpz413a5f0rKKV GEiA== X-Gm-Message-State: AOJu0YxwhnpsC8PafxoLzTuFqZrML7sTDV3tbDPUvbH5n767+inokqXO kDmqvlN6DwfVEewW9biQydN7DZVrV1ayMDZJK+7wkVVjg4cP+di30/wgPfkr7qS92sJ/+VchlVK Nmw== X-Google-Smtp-Source: AGHT+IEs12hxacHOQKcOvZGwVnsEARTSm91THiSd/m0uNG8VpGMuP9+Vl4DlPGBfGEahtxlSE8ogXA== X-Received: by 2002:adf:e40d:0:b0:339:5951:801d with SMTP id g13-20020adfe40d000000b003395951801dmr5999535wrm.6.1706616655391; Tue, 30 Jan 2024 04:10:55 -0800 (PST) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id f9-20020a056000036900b00339307d9d31sm10569894wrf.112.2024.01.30.04.10.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:10:54 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Arthur Cohen Subject: [COMMITTED 007/101] gccrs: rib: Add Namespace enum Date: Tue, 30 Jan 2024 13:06:23 +0100 Message-ID: <20240130121026.807464-10-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20240130121026.807464-2-arthur.cohen@embecosm.com> References: <20240130121026.807464-2-arthur.cohen@embecosm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-14.1 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-rib.h: Add Namespace enum. --- gcc/rust/resolve/rust-rib.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gcc/rust/resolve/rust-rib.h b/gcc/rust/resolve/rust-rib.h index 37bd90f1f75..4ffd00a5d6c 100644 --- a/gcc/rust/resolve/rust-rib.h +++ b/gcc/rust/resolve/rust-rib.h @@ -27,6 +27,31 @@ namespace Rust { namespace Resolver2_0 { +/** + +pub enum Namespace { + /// The type namespace includes `struct`s, `enum`s, `union`s, `trait`s, and +`mod`s + /// (and, by extension, crates). + /// + /// Note that the type namespace includes other items; this is not an + /// exhaustive list. + TypeNS, + /// The value namespace includes `fn`s, `const`s, `static`s, and local +variables (including function arguments). ValueNS, + /// The macro namespace includes `macro_rules!` macros, declarative `macro`s, + /// procedural macros, attribute macros, `derive` macros, and non-macro +attributes + /// like `#[inline]` and `#[rustfmt::skip]`. + MacroNS, +} + +*/ + +// FIXME: There's no `labels` namespace, not sure if we need one or how to keep +// one +// FIXME: And where are things like loop labels kept? + /** * All namespaces that Rust's name resolution needs to handle */