about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2018-08-14 12:54:43 +0300
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2018-08-17 12:59:56 +0300
commit9b1d3c70ac5e16fd43daf0b56c739c6bd5ded3fd (patch)
treeb47216975385dbe36c9bd79cc651acb0b74358b7 /src/doc
parentd06fa3a46f8e6c938f51718ed964007a81d12a7d (diff)
downloadrust-9b1d3c70ac5e16fd43daf0b56c739c6bd5ded3fd.tar.gz
rust-9b1d3c70ac5e16fd43daf0b56c739c6bd5ded3fd.zip
rustc_resolve: don't allow paths starting with `::crate`.
Diffstat (limited to 'src/doc')
-rw-r--r--src/doc/unstable-book/src/language-features/crate-in-paths.md9
-rw-r--r--src/doc/unstable-book/src/language-features/extern-absolute-paths.md2
2 files changed, 3 insertions, 8 deletions
diff --git a/src/doc/unstable-book/src/language-features/crate-in-paths.md b/src/doc/unstable-book/src/language-features/crate-in-paths.md
index f1656993e87..9901dc1ebe3 100644
--- a/src/doc/unstable-book/src/language-features/crate-in-paths.md
+++ b/src/doc/unstable-book/src/language-features/crate-in-paths.md
@@ -9,10 +9,6 @@ The tracking issue for this feature is: [#44660]
 The `crate_in_paths` feature allows to explicitly refer to the crate root in absolute paths
 using keyword `crate`.
 
-`crate` can be used *only* in absolute paths, i.e. either in `::crate::a::b::c` form or in `use`
-items where the starting `::` is added implicitly.  
-Paths like `crate::a::b::c` are not accepted currently.
-
 This feature is required in `feature(extern_absolute_paths)` mode to refer to any absolute path
 in the local crate (absolute paths refer to extern crates by default in that mode), but can be
 used without `feature(extern_absolute_paths)` as well.
@@ -39,15 +35,14 @@ mod n
     use crate as root;
     pub fn check() {
         assert_eq!(f(), 1);
-        // `::` is required in non-import paths
-        assert_eq!(::crate::m::g(), 2);
+        assert_eq!(crate::m::g(), 2);
         assert_eq!(root::m::h(), 3);
     }
 }
 
 fn main() {
     assert_eq!(f(), 1);
-    assert_eq!(::crate::m::g(), 2);
+    assert_eq!(crate::m::g(), 2);
     assert_eq!(root::m::h(), 3);
     n::check();
 }
diff --git a/src/doc/unstable-book/src/language-features/extern-absolute-paths.md b/src/doc/unstable-book/src/language-features/extern-absolute-paths.md
index f45c5053e8d..6a22e7eba64 100644
--- a/src/doc/unstable-book/src/language-features/extern-absolute-paths.md
+++ b/src/doc/unstable-book/src/language-features/extern-absolute-paths.md
@@ -12,7 +12,7 @@ The `extern_absolute_paths` feature enables mode allowing to refer to names from
 `::my_crate::a::b` will resolve to path `a::b` in crate `my_crate`.
 
 `feature(crate_in_paths)` can be used in `feature(extern_absolute_paths)` mode for referring
-to absolute paths in the local crate (`::crate::a::b`).
+to absolute paths in the local crate (`crate::a::b`).
 
 `feature(extern_in_paths)` provides the same effect by using keyword `extern` to refer to
 paths from other crates (`extern::my_crate::a::b`).