Skip to content

Commit e32a2f9

Browse files
authored
Merge pull request #974 from Manishearth/crate-root
Clarify that ::foo paths are not necessarily based off of the "crate root"
2 parents ad25b87 + 80241b4 commit e32a2f9

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/paths.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,17 @@ how it is resolved.
159159

160160
### `::`
161161

162-
Paths starting with `::` are considered to be global paths where the segments of the path
163-
start being resolved from the crate root. Each identifier in the path must resolve to an
164-
item.
165-
166-
> **Edition Differences**: In the 2015 Edition, the crate root contains a variety of
167-
> different items, including external crates, default crates such as `std` or `core`, and
168-
> items in the top level of the crate (including `use` imports).
162+
Paths starting with `::` are considered to be *global paths* where the segments of the path
163+
start being resolved from a place which differs based on edition. Each identifier in
164+
the path must resolve to an item.
165+
166+
> **Edition Differences**: In the 2015 Edition, identifiers resolve from the "crate root"
167+
> (`crate::` in the 2018 edition), which contains a variety of different items, including
168+
> external crates, default crates such as `std` or `core`, and items in the top level of
169+
> the crate (including `use` imports).
169170
>
170-
> Beginning with the 2018 Edition, paths starting with `::` can only reference
171-
> crates in the [extern prelude].
171+
> Beginning with the 2018 Edition, paths starting with `::` resolve from
172+
> crates in the [extern prelude]. That is, they must be followed by the name of a crate.
172173
173174
```rust
174175
mod a {

0 commit comments

Comments
 (0)