Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,17 @@ how it is resolved.

### `::`

Paths starting with `::` are considered to be global paths where the segments of the path
start being resolved from the crate root. Each identifier in the path must resolve to an
item.

> **Edition Differences**: In the 2015 Edition, the crate root contains a variety of
> different items, including external crates, default crates such as `std` or `core`, and
> items in the top level of the crate (including `use` imports).
Paths starting with `::` are considered to be "global paths" where the segments of the path
start being resolved from a place which differs based on edition. Each identifier in
the path must resolve to an item.

> **Edition Differences**: In the 2015 Edition, identifiers resolve from the "crate root"
> (`crate::` in the 2018 edition), which contains a variety of different items, including
> external crates, default crates such as `std` or `core`, and items in the top level of
> the crate (including `use` imports).
>
> Beginning with the 2018 Edition, paths starting with `::` can only reference
> crates in the [extern prelude].
> Beginning with the 2018 Edition, paths starting with `::` resolve from
> crates in the [extern prelude], i.e. they _must_ be followed by the name of a crate.

```rust
mod a {
Expand Down