Skip to content

Commit 3771e7a

Browse files
committed
move this section up a bit
1 parent eb897dd commit 3771e7a

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

posts/2019-01-17-Rust-1.32.0.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,30 @@ you do need it, it's a few lines of code away.
202202
[jemalloc]: http://jemalloc.net/
203203
[the jemallocator crate]: https://crates.io/crates/jemallocator
204204

205+
#### Final module improvements
206+
207+
In the past two releases, we announced several improvements to the module
208+
system. We have one last tweak landing in 1.32.0 and the 2018 edition.
209+
Nicknamed ["uniform
210+
paths"](https://github.com/rust-lang/rust/pull/56759#issuecomment-450051210),
211+
it permits previously invalid import path statements to be resolved exactly
212+
the same way as non-import paths. For example:
213+
214+
```rust
215+
enum Color { Red, Green, Blue }
216+
217+
use Color::*;
218+
```
219+
220+
This code did *not* previously compile, as `use` statements had to start with
221+
`super`, `self`, or `crate`. Now that the compiler supports uniform paths,
222+
this code will work, and do what you probably expect: import the variants of
223+
the `Color` enum defined above the `use` statement.
224+
225+
With this change in place, we've completed our efforts at revising the module
226+
system. We hope you've been enjoying the simplified system so far!
227+
228+
205229
#### Macro improvements
206230

207231
A few improvements to macros have landed in Rust 1.32.0. First, [a new
@@ -230,29 +254,6 @@ macro_rules! bar {
230254
The `?` will match zero or one repetitions of the pattern, similar to the
231255
already-existing `*` for "zero or more" and `+` for "one or more."
232256

233-
#### Final module improvements
234-
235-
In the past two releases, we announced several improvements to the module
236-
system. We have one last tweak landing in 1.32.0 and the 2018 edition.
237-
Nicknamed ["uniform
238-
paths"](https://github.com/rust-lang/rust/pull/56759#issuecomment-450051210),
239-
it permits previously invalid import path statements to be resolved exactly
240-
the same way as non-import paths. For example:
241-
242-
```rust
243-
enum Color { Red, Green, Blue }
244-
245-
use Color::*;
246-
```
247-
248-
This code did *not* previously compile, as `use` statements had to start with
249-
`super`, `self`, or `crate`. Now that the compiler supports uniform paths,
250-
this code will work, and do what you probably expect: import the variants of
251-
the `Color` enum defined above the `use` statement.
252-
253-
With this change in place, we've completed our efforts at revising the module
254-
system. We hope you've been enjoying the simplified system so far!
255-
256257
### Library stabilizations
257258

258259
We talked above about the `dbg!` macro, which is a big library addition.

0 commit comments

Comments
 (0)