Skip to content

Commit 2187a65

Browse files
committed
Add note emphasizing why the migration does a "compiles on both" strategy.
1 parent 36530e2 commit 2187a65

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/editions/advanced-migrations.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44

55
[`cargo fix --edition`][`cargo fix`] works by running the equivalent of [`cargo check`] on your project with special [lints] enabled which will detect code that may not compile in the next edition.
66
These lints include instructions on how to modify the code to make it compatible on both the current and the next edition.
7-
`cargo fix` applies these changes to the source code, and then runs `cargo check` again to verify the fixes work.
7+
`cargo fix` applies these changes to the source code, and then runs `cargo check` again to verify that the fixes work.
88
If the fixes fail, then it will back out the changes and display a warning.
99

10+
Changing the code to be simultaneously compatible with both the current and next edition makes it easier to incrementally migrate the code.
11+
If the automated migration does not completely succeed, or requires manual help, you can iterate while staying on the original edition before changing `Cargo.toml` to use the next edition.
12+
1013
The lints that `cargo fix --edition` apply are part of a [lint group].
1114
For example, when migrating from 2018 to 2021, Cargo uses the `rust-2021-compatibility` group of lints to fix the code.
1215
Check the [Partial migration](#partial-migration-with-broken-code) section below for tips on using individual lints to help with migration.

0 commit comments

Comments
 (0)