Skip to content

Commit 23b3e84

Browse files
vornermark-i-m
authored andcommitted
Second pass of name resolution
Just small little tweaks
1 parent 5636a64 commit 23b3e84

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/name-resolution.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
The name resolution is a separate pass in the compiler. Its input is the syntax
44
tree, produced by parsing input files. It produces links from all the names in
55
the source to relevant places where the name was introduced. It also generates
6-
helpful error messages, like typo suggestions or traits to import.
6+
helpful error messages, like typo suggestions, traits to import or lints about
7+
unused items.
8+
9+
A successful run of the name resolution (`Resolver::resolve_crate`) creates kind
10+
of an index the rest of the compilation may use to ask about the present names
11+
(through the `hir::lowering::Resolver` interface).
712

813
The name resolution lives in the `librustc_resolve` crate, with the meat in
914
`lib.rs` and some helpers or symbol-type specific logic in the other modules.
@@ -72,6 +77,8 @@ fn do_something<T: Default>(val: T) { // <- New rib in both types and values (1)
7277

7378
Because the rules for different namespaces are a bit different, each namespace
7479
has its own independent rib stack that is constructed in parallel to the others.
80+
In addition, there's also a rib stack for local labels (eg. names of loops or
81+
blocks), which isn't a full namespace in its own right.
7582

7683
## Overall strategy
7784

0 commit comments

Comments
 (0)