[COMMITTED 007/101] gccrs: rib: Add Namespace enum

arthur.cohen@embecosm.com arthur.cohen@embecosm.com
Tue Jan 30 12:06:23 GMT 2024


From: Arthur Cohen <arthur.cohen@embecosm.com>

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
  */
-- 
2.42.1



More information about the Gcc-rust mailing list