@@ -21,18 +21,44 @@ You can get `rustfix` from crates.io. Given that you're probably using Cargo,
21
21
you'll want to run this:
22
22
23
23
``` shell
24
- $ cargo +nightly install cargo-fix --git https://github.com/killercup /rustfix.git
24
+ $ cargo install cargo-fix --git https://github.com/rust-lang-nursery /rustfix
25
25
```
26
26
27
- And that's it! Note that you do need a nightly Cargo to use ` rustfix ` at the
28
- moment; in fact, all of the edition stuff is nightly only for now. Eventually
29
- this will be stable! Same with installing from ` git ` , for now, it's needed.
27
+ And that's it!
30
28
31
29
## Prepare for the next edition
32
30
31
+ Before we talk about how to move to the new edition, a reminder:
32
+
33
+
34
+ * New editions may have features that are only available in the new edition.
35
+ For example, ` async ` /` await ` is available in Rust 2018, but not Rust 2015.
36
+ * It's our intention that the migration to new editions is as smooth an experience
37
+ as possible. It's considered a bug if it's difficult to upgrade your crate to
38
+ a new edition. If you have a difficult time then a bug should be filed
39
+ with either rustfix or Rust itself.
40
+
41
+ With that out of the way, let's get into it!
42
+
43
+ ### The preview period
44
+
45
+ First, editions have a "preview" phase. This lets you try out the new edition
46
+ in nightly Rust. During the preview, there's an extra step you need to take
47
+ to opt in. At the time of writing, Rust 2018 is in its preview phase.
48
+
49
+ To do that, add this feature flag to your ` lib.rs ` or ` main.rs ` :
50
+
51
+ ``` rust
52
+ #![feature(rust_2018_preview)]
53
+ ```
54
+
55
+ This will ensure that you're enabling all of the relevant features.
56
+
57
+ ### Running rustfix
58
+
33
59
There are some lints that can help you prepare for the next edition, but
34
- they're not currently turned on by default. ` rustfix ` has your back
35
- though! To turn them on and have ` rustfix ` fix up your code, run this:
60
+ they're not currently turned on by default. ` rustfix ` has your back though!
61
+ To turn them on and have ` rustfix ` fix up your code, run this:
36
62
37
63
``` shell
38
64
$ cargo +nightly fix --prepare-for 2018
0 commit comments