Skip to content

Commit 41852d9

Browse files
author
Nick Cameron
committed
Some final clarifying points
1 parent ffbb2f7 commit 41852d9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

text/0000-macro-naming.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ as other items by an `extern crate` item.
118118
No `#[macro_use]` or `#[macro_export]` annotations are required.
119119

120120

121+
## Shadowing
122+
123+
Macro names follow the same shadowing rules as other names. For example, an
124+
explicitly declared macro would shadow a glob-imported macro with the same name.
125+
Note that since macros are in a different namespace from types and values, a
126+
macro cannot shadow a type or value or vice versa.
127+
128+
121129
# Drawbacks
122130
[drawbacks]: #drawbacks
123131

@@ -167,3 +175,13 @@ for a future RFC.
167175
Some day, I hope that procedural macros may be defined in the same crate in
168176
which they are used. I leave the details of this for later, however, I don't
169177
think this affects the design of naming - it should all Just Work.
178+
179+
## Applying to existing macros
180+
181+
This RFC is framed in terms of a new macro system. There are various ways that
182+
some parts of it could be applied to existing macros (`macro_rules!`) to
183+
backwards compatibly make existing macros usable under the new naming system.
184+
185+
I want to leave this question unanswered for now. Until we get some experience
186+
implementing this feature it is unclear how much this is possible. Once we know
187+
that we can try to decide how much of that is also desirable.

0 commit comments

Comments
 (0)