@@ -52,7 +52,7 @@ new 2018 edition. This is where the handy `cargo fix` tool comes into the
52
52
picture. To enable the compatibility lints for your project you run:
53
53
54
54
``` shell
55
- $ cargo +nightly fix --prepare-for 2018 --all-targets --all-features
55
+ $ cargo fix --edition
56
56
```
57
57
58
58
This will instruct Cargo to compile all targets in your project (libraries,
@@ -67,7 +67,7 @@ warnings. Continue to run the above command until all warnings have been solved.
67
67
You can explore more about the ` cargo fix ` command with:
68
68
69
69
``` shell
70
- $ cargo +nightly fix --help
70
+ $ cargo fix --help
71
71
```
72
72
73
73
## Switch to the next edition
@@ -86,7 +86,7 @@ That `cargo-features` line should go at the very top; and `edition` goes into
86
86
the ` [package] ` section. As mentioned above, right now this is a nightly-only
87
87
feature of Cargo, so you need to enable it for things to work.
88
88
89
- At this point, your project should compile with a regular old `cargo +nightly
89
+ At this point, your project should compile with a regular old `cargo
90
90
build`. If it does not, this is a bug! Please [ file an issue] [ issue ] .
91
91
92
92
[ issue ] : https://github.com/rust-lang/rust/issues/new
@@ -98,22 +98,17 @@ that Editions in Rust signify a shift in idioms over time. While much old
98
98
code will continue to compile it might be written with different idioms today.
99
99
100
100
An optional next step you can take is to update your code to be idiomatic within
101
- the new edition. This is done with a different set of "idiom lints". To enable
102
- these lints add this to your ` lib.rs ` or ` main.rs ` :
103
-
104
- ``` rust
105
- #![warn(rust_2018_idioms)]
106
- ```
107
-
108
- Note that since you already switched to the new edition in the previous section,
109
- you should no longer pass the ` --prepare-for 2018 ` flag to ` cargo fix ` because
110
- you are now already on the next edition! Execute:
101
+ the new edition. This is done with a different set of "idiom lints". Like before
102
+ we'll be using ` cargo fix ` to drive this process:
111
103
112
104
``` shell
113
- $ cargo +nightly fix
105
+ $ cargo fix --edition-idioms
114
106
```
115
107
116
- As before Cargo will automatically fix as much as it can, but you may also need
117
- to fix some warnings manually. Once all warnings have been solved you're not
118
- only compiling with the 2018 edition but you're also already writing idiomatic
119
- 2018 code!
108
+ Additionally like before, this is intended to be an * easy* step. Here `cargo
109
+ fix` will automatically fix any lints it can, so you'll only get warnings for
110
+ things that ` cargo fix ` couldn't fix. If you find it difficult to work through
111
+ the warnings, that's a bug!
112
+
113
+ Once you're warning-free with this command you're good to go. Enjoy the new
114
+ edition!
0 commit comments