Skip to content

Commit f5b5649

Browse files
committed
path-clarity: Change "use statements" to "use declarations"
1 parent f3a841f commit f5b5649

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/rust-2018/path-clarity.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ Here's a brief summary:
2323

2424
* `extern crate` is no longer needed
2525
* The `crate` keyword refers to the current crate.
26-
* Relative paths variant: Paths work uniformly in both `use` statements and in
27-
other code, both in the top-level module and in submodules, and may use
26+
* Relative paths variant: Paths work uniformly in both `use` declarations and
27+
in other code, both in the top-level module and in submodules, and may use
2828
either absolute paths or local names relative to the current module.
29-
* Absolute use paths variant: Paths in `use` statements are always absolute and
30-
begin with a crate name (or `crate`); paths in other code may use absolute
31-
paths or local names relative to the current module.
29+
* Absolute use paths variant: Paths in `use` declarations are always absolute
30+
and begin with a crate name (or `crate`); paths in other code may use
31+
absolute paths or local names relative to the current module.
3232
* A `foo.rs` and `foo/` subdirectory may coexist; `mod.rs` is no longer needed
3333
when placing submodules in a subdirectory.
3434

@@ -74,10 +74,10 @@ Check [the macro section](2018/transitioning/modules/macros.html) for more.
7474

7575
### The `crate` keyword refers to the current crate.
7676

77-
In `use` statements and in other code, you can refer to the root of the current
78-
crate with the `crate::` prefix. For instance, `crate::foo::bar` will always
79-
refer to the name `bar` inside the module `foo`, from anywhere else in the same
80-
crate.
77+
In `use` declarations and in other code, you can refer to the root of the
78+
current crate with the `crate::` prefix. For instance, `crate::foo::bar` will
79+
always refer to the name `bar` inside the module `foo`, from anywhere else in
80+
the same crate.
8181

8282
The prefix `::` previously referred to either the crate root or an external
8383
crate; it now unambiguously refers to an external crate. For instance,
@@ -86,14 +86,14 @@ crate; it now unambiguously refers to an external crate. For instance,
8686
### Relative paths variant
8787

8888
The relative paths variant of Rust 2018 simplifies and unifies path handling
89-
compared to Rust 2015. In Rust 2015, paths work differently in use statements
90-
than they do elsewhere. In particular, paths in `use` statements would always
91-
start from the crate root, while paths in other code implicitly started from
92-
the current module. Those differences didn't have any effect in the top-level
93-
module, which meant that everything would seem straightforward until working on
94-
a project large enough to have submodules.
95-
96-
In the relative paths variant of Rust 2018, paths in `use` statements and in
89+
compared to Rust 2015. In Rust 2015, paths work differently in `use`
90+
declarations than they do elsewhere. In particular, paths in `use`
91+
declarations would always start from the crate root, while paths in other code
92+
implicitly started from the current module. Those differences didn't have any
93+
effect in the top-level module, which meant that everything would seem
94+
straightforward until working on a project large enough to have submodules.
95+
96+
In the relative paths variant of Rust 2018, paths in `use` declarations and in
9797
other code always work the same way, both in the top-level module and in any
9898
submodule. You can either use a relative path from the current module, an
9999
absolute path from the top of the current crate (starting with `crate::`), or
@@ -206,7 +206,7 @@ To explicitly disambiguate a path, use `::name` for an external crate name, or
206206

207207
### Absolute use paths variant
208208

209-
In the absolute use paths variant of Rust 2018, paths in `use` statements
209+
In the absolute use paths variant of Rust 2018, paths in `use` declarations
210210
*must* begin with one of:
211211

212212
- A crate name
@@ -246,9 +246,9 @@ mod foo {
246246
use crate::foo::Bar;
247247
```
248248

249-
In addition, all of these path forms are available outside of `use` statements
250-
as well, which eliminates many sources of confusion. Consider this code in Rust
251-
2015:
249+
In addition, all of these path forms are available outside of `use`
250+
declarations as well, which eliminates many sources of confusion. Consider this
251+
code in Rust 2015:
252252

253253
```rust,ignore
254254
// Rust 2015

0 commit comments

Comments
 (0)