@@ -20,7 +20,7 @@ Here's a brief summary:
2020* Paths starting with ` :: ` must reference an external crate.
2121* A ` foo.rs ` and ` foo/ ` subdirectory may coexist; ` mod.rs ` is no longer needed
2222 when placing submodules in a subdirectory.
23- * ` use ` declarations take [ uniform paths] ( #uniform-paths ) .
23+ * Paths in ` use ` declarations work the same as other paths.
2424
2525These may seem like arbitrary new rules when put this way, but the mental
2626model is now significantly simplified overall. Read on for more details!
@@ -140,9 +140,6 @@ mod submodule {
140140 // but in a submodule it requires a leading :: if not imported with `use`
141141 let x = ::chrono::Utc::now();
142142 }
143-
144- // unlike expressions, `use` paths were allowed to reference crates directly
145- use chrono::Local;
146143}
147144```
148145
@@ -162,9 +159,6 @@ mod submodule {
162159 // crates may be referenced directly, even in submodules
163160 let x = chrono::Utc::now();
164161 }
165-
166- // `use` paths have the same path style
167- use chrono::Local;
168162}
169163```
170164
@@ -201,23 +195,22 @@ and the submodule is still `foo/bar.rs`. This eliminates the special
201195name, and if you have a bunch of files open in your editor, you can clearly
202196see their names, instead of having a bunch of tabs named ` mod.rs ` .
203197
204- # Uniform paths
198+ ### ` use ` paths
205199
206200![ Minimum Rust version: 1.32] ( https://img.shields.io/badge/Minimum%20Rust%20Version-1.32-brightgreen.svg )
207201
208- The uniform paths variant of Rust 2018 simplifies and unifies path handling
209- compared to Rust 2015. In Rust 2015 , paths work differently in ` use `
210- declarations than they do elsewhere. In particular, paths in ` use `
211- declarations would always start from the crate root, while paths in other code
212- implicitly started from the current scope. Those differences didn't have any
213- effect in the top-level module, which meant that everything would seem
214- straightforward until working on a project large enough to have submodules.
202+ Rust 2018 simplifies and unifies path handling compared to Rust 2015. In Rust
203+ 2015, paths work differently in ` use ` declarations than they do elsewhere. In
204+ particular, paths in ` use ` declarations would always start from the crate
205+ root, while paths in other code implicitly started from the current scope.
206+ Those differences didn't have any effect in the top-level module, which meant
207+ that everything would seem straightforward until working on a project large
208+ enough to have submodules.
215209
216- In the uniform paths variant of Rust 2018, paths in ` use ` declarations and in
217- other code almost always work the same way, both in the top-level module and
218- in any submodule. You can use a relative path from the current scope, a path
219- starting from an external crate name, or a path starting with ` crate ` ,
220- ` super ` , or ` self ` .
210+ In Rust 2018, paths in ` use ` declarations and in other code work the same way,
211+ both in the top-level module and in any submodule. You can use a relative path
212+ from the current scope, a path starting from an external crate name, or a path
213+ starting with ` crate ` , ` super ` , or ` self ` .
221214
222215Code that looked like this:
223216
@@ -255,7 +248,7 @@ will look exactly the same in Rust 2018, except that you can delete the `extern
255248crate` line:
256249
257250``` rust,ignore
258- // Rust 2018 (uniform paths variant)
251+ // Rust 2018
259252
260253use futures::Future;
261254
@@ -282,11 +275,10 @@ fn func() {
282275}
283276```
284277
285- With uniform paths, however, the same code will also work completely unmodified in
286- a submodule:
278+ The same code will also work completely unmodified in a submodule:
287279
288280``` rust,ignore
289- // Rust 2018 (uniform paths variant)
281+ // Rust 2018
290282
291283mod submodule {
292284 use futures::Future;
0 commit comments