From 32ff399805cfa257ef0e8245550472cf88767a9d Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Sun, 7 Mar 2021 13:04:05 -0800 Subject: [PATCH 1/3] Clarify that ::foo paths are not necessarily based off of the "crate root" --- src/paths.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/paths.md b/src/paths.md index c0b2e6ff3..78b0728b0 100644 --- a/src/paths.md +++ b/src/paths.md @@ -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 { From b9b5502dc26dad9b0de8d24d38642395479e908a Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Sun, 7 Mar 2021 22:45:20 -0800 Subject: [PATCH 2/3] Update src/paths.md Co-authored-by: Ryan Scheel --- src/paths.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/paths.md b/src/paths.md index 78b0728b0..82b6c5d02 100644 --- a/src/paths.md +++ b/src/paths.md @@ -159,7 +159,7 @@ how it is resolved. ### `::` -Paths starting with `::` are considered to be "global paths" where the segments of the path +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. From 80241b46c68380735f05fb53bd99632b87ac2872 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Sun, 7 Mar 2021 22:45:26 -0800 Subject: [PATCH 3/3] Update src/paths.md Co-authored-by: Ryan Scheel --- src/paths.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/paths.md b/src/paths.md index 82b6c5d02..2bf921c8d 100644 --- a/src/paths.md +++ b/src/paths.md @@ -169,7 +169,7 @@ the path must resolve to an item. > the crate (including `use` imports). > > 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. +> crates in the [extern prelude]. That is, they must be followed by the name of a crate. ```rust mod a {