@@ -28,19 +28,22 @@ manually!
28
28
29
29
## The preview period
30
30
31
- First, editions have a "preview" phase. This lets you try out the new edition
32
- in nightly Rust. During the preview, there's an extra step you need to take
33
- to opt in. At the time of writing, Rust 2018 is in its preview phase.
34
-
35
- To do that, add this feature flag to your ` lib.rs ` or ` main.rs ` :
31
+ Before an edition is released, it will have a "preview" phase which lets you
32
+ try out the new edition in nightly Rust before its release. Currently Rust 2018
33
+ is in its preview phase and because of this, there's an extra step you need to
34
+ take to opt in. Add this feature flag to your ` lib.rs ` or ` main.rs ` :
36
35
37
36
``` rust
38
37
#![feature(rust_2018_preview)]
39
38
```
40
39
41
- This will ensure that you're enabling all of the relevant features. Note that
42
- during the time the preview is available, we may continue to add/enable new
43
- features with this flag!
40
+ This will enable the unstable features listed in the [ feature status] [ status ]
41
+ page. Note that some features require a miniumum of Rust 2018 and these features will
42
+ require a Cargo.toml change to enable (described in the sections below). Also
43
+ note that during the time the preview is available, we may continue to add/enable
44
+ new features with this flag!
45
+
46
+ [ status ] : 2018/status.html
44
47
45
48
## Fix edition compatibility warnings
46
49
@@ -55,7 +58,8 @@ $ cargo +nightly fix --prepare-for 2018 --all-targets --all-features
55
58
This will instruct Cargo to compile all targets in your project (libraries,
56
59
binaries, tests, etc.) while enabling all Cargo features and prepare them for
57
60
the 2018 edition. Cargo will likely automatically fix a number of files,
58
- informing you as it goes along.
61
+ informing you as it goes along. Note that this does not enable any new Rust
62
+ 2018 features; it only makes sure your code is compatible with Rust 2018.
59
63
60
64
If Cargo can't automatically fix everything it'll print out the remaining
61
65
warnings. Continue to run the above command until all warnings have been solved.
@@ -66,7 +70,7 @@ You can explore more about the `cargo fix` command with:
66
70
$ cargo +nightly fix --help
67
71
```
68
72
69
- ## Commit to the next edition
73
+ ## Switch to the next edition
70
74
71
75
Once you're happy with those changes, it's time to use the new edition.
72
76
Add this to your ` Cargo.toml ` :
0 commit comments