Don't reference librustc_resolve just yet.
It's mentioned further down with more details.
This commit is contained in:
parent
5d735ad4d4
commit
ff764756e3
|
|
@ -12,10 +12,10 @@ let x: x = 1;
|
||||||
let y: x = 2;
|
let y: x = 2;
|
||||||
```
|
```
|
||||||
|
|
||||||
How do we know on line 3 whether `x` is a type (u32) or a value (1)?
|
How do we know on line 3 whether `x` is a type (u32) or a value (1)? These
|
||||||
These conflicts are resolved in `librustc_resolve`.
|
conflicts are resolved during name resolution. In this specific case, name
|
||||||
In this specific case, name resolution defines that type names and variable
|
resolution defines that type names and variable names live in separate
|
||||||
names live in separate namespaces and therefore can co-exist.
|
namespaces and therefore can co-exist.
|
||||||
|
|
||||||
The name resolution in Rust is a two-phase process. In the first phase, which runs
|
The name resolution in Rust is a two-phase process. In the first phase, which runs
|
||||||
during macro expansion, we build a tree of modules and resolve imports. Macro
|
during macro expansion, we build a tree of modules and resolve imports. Macro
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue