-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
tracking my progress on researching this part of name resolution and how it works. Including a copy of the daily personal notes I take on the subject
Outline
I'm going to keep this section up to date with the draft outline in my notes
-
Outline
- names.resolution
- .early
- .intro
- early name resolution is part of macro expansion and is necessary to fully generate the AST of a rust crate
- should I even mention ASTs? explaining why it exists seems to necessarily go into implementation details
- the AST is mentioned in other parts of the reference, including the macros section, so possibly this is fine
- imports are resolved to assist in macro resolution
- macros are resolved so they can be expanded
- this process is iterative and repeats until no progress can be made (fixed point algorithm)
- I think I might be able to include this but not mention how this means it's a fixed point algorithm
- Post expansion these resolutions are checked again to ensure no new ambiguities were introduced by the expansion process
- I think I might be able to include this but not mention how this means it's a fixed point algorithm
- Note: This section seems to be largely related to implementation details, will probably need to trim it down to just the bits that are relevant to language, possibly just noting the relationship to macro expansion
- early name resolution is part of macro expansion and is necessary to fully generate the AST of a rust crate
- .imports
- .shadowing
- names bindings resolved through non-glob imports shadow names bindings resolved through glob imports
- .macro-textual-scope
- textual scope name bindings for macros may shadow path-based scope bindings to macros (the later may be unresolved, in which case it doesn't matter if it's a macro)
- .errors
- .reserved-names
id:: 68acc38b-20bd-4f49-99ad-92e98d136e7b- the names
cfg
andcfg_attr
are reserved in the macro attribute sub-namespace
- the names
- .ambiguity
id:: 68acc63c-c157-4f82-9bf6-8f439017b1ed- BuiltinAttr
- it is an error to have a user defined attribute or derive macro with the same name as a builtin attribute (e.g. inline)
- DeriveHelper
- derive helpers used before their associated derive may not shadow other attributes or other derive helpers that are otherwise in scope after their derive
- MacroRulesVsModularized
- path-based scope bindings for macros may not shadow textual scope bindings to macros
- GlobVsOuter
- it is an error to shadow an outer name binding with a glob import
- GlobVsGlob
- it is an error to name an item through ambiguous use declarations
id:: 68b0a2d7-52ce-462a-a166-f8e796a13aca- two globs imports which both have an item matching that name where the items are different
id:: 68b0a2d7-e8c3-420a-87ee-b875f54e6e15- this is still an error even if there is a third non glob binding resolution to an item with the same name
- two globs imports which both have an item matching that name where the items are different
- it is not an error to have two glob imports which include items which would be ambiguous so long as you do not name one of those items through the ambiguous glob imports
- it is an error to name an item through ambiguous use declarations
- GlobVsExpanded
- Grey Area
- MoreExpandedVsOuter
- it is an error for name bindings from macro expansions to shadow name bindings from outside of those expansions
- BuiltinAttr
- .reserved-names
- shadowing and ambiguity may or may not represent the same section or one may be a subsection of the other
- .shadowing
- .macros
- .intro
- .late
- .early
- names.resolution
Metadata
Metadata
Assignees
Labels
No labels