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: 194062 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1180737dyb; Tue, 30 Jan 2024 04:23:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQipqssJNfElyzAX2V8bWQsOlZ0eizuYxhKEB8BWFHyet6u0x30m6oadvAKM2ABV7oFKN7 X-Received: by 2002:ac8:5a04:0:b0:42a:9d70:7f58 with SMTP id n4-20020ac85a04000000b0042a9d707f58mr1565502qta.49.1706617428023; Tue, 30 Jan 2024 04:23:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706617428; cv=pass; d=google.com; s=arc-20160816; b=LzfeLeMWy2BSJuqf4lpXrAzoVu058V/pBjjTp/jtul2hXL+kvg14K5LH1PZ/exIcrK GztZlSrTAo7W+hRArMWYMf75xZrQFTrhHQGGjNAUHqvvUxGMcQ3j/yJRL/00NyBoltQz PYU8Oy0WqVQpmnx6t/K1bBtt4iacantvnOeN4y6peaH4b3PO9AIAaZ5ioVsSJZTxiRV8 y51k9i9HC/smCewU8ppNcbzpzO/cclPigvg5mkUFyqMIoQQ7w4EA7h6NiimXKO5OKwSj pJi5TwScSIjOYIW46CcSKXTkFpFSlTU8CCVNzdG/yEgJGz2V1DxSSlh9RPazpCMtKCG6 cBag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=UFUj8oXvszxBtgA1dFNDIG0cvROUwhGsgQytSRWEMVs=; fh=6KiXNvQww/MsyVplklPLl//mUuD+DtDm73nSHh4O4+g=; b=v4SpI2nO22Qh46uSqbK6waUs7R+fwh8HG28OhdsH9yh6e2P99vsVS1X1C7WXLLzj/y nX4fQWELCU+EfBAb01lTR1qUYs9gosz7ugq7NM0k+yKp5neBsgCvKFKo5/puvEdZ/iCT OGDRHu6XyeRiUZ+0DUqiUcS0R19+b4CREHJzZTYhD5pbHwR9xJy4wbAU6exukheqzfd0 11Zo2XvzvjC8XBZ4nPk53OoLmfs8OEcF7jTRqvNK41UTUgL4NJkI6ZqS1NLwGJjzNDGN CbKagVfyBdX6mMGLSd6zfHc9HMkUwPss4RyoPG3upCzyk8tcrxb1mJZ0ECKBZyX6MzAo IVBw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b="cfmyxD/8"; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id b21-20020ac85bd5000000b0042aa7502e95si4012757qtb.752.2024.01.30.04.23.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:23:48 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b="cfmyxD/8"; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 943CA3857C60 for ; Tue, 30 Jan 2024 12:23:47 +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-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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789518076589306809 X-GMAIL-MSGID: 1789518076589306809 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 */