File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 3
3
The name resolution is a separate pass in the compiler. Its input is the syntax
4
4
tree, produced by parsing input files. It produces links from all the names in
5
5
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).
7
12
8
13
The name resolution lives in the ` librustc_resolve ` crate, with the meat in
9
14
` 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)
72
77
73
78
Because the rules for different namespaces are a bit different, each namespace
74
79
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.
75
82
76
83
## Overall strategy
77
84
You can’t perform that action at this time.
0 commit comments