Skip to content

Commit 15513ce

Browse files
committed
Add some more details to the cargo fix --edition procedure.
1 parent aa61976 commit 15513ce

4 files changed

Lines changed: 31 additions & 8 deletions

File tree

src/doc/man/cargo-fix.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,15 @@ or feature requests please don't hesitate to file an issue at
4444
The `cargo fix` subcommand can also be used to migrate a package from one
4545
[edition] to the next. The general procedure is:
4646

47-
1. Run `cargo fix --edition`
47+
1. Run `cargo fix --edition`. Consider also using the `--all-features` flag if
48+
your project has multiple features. You may also want to run `cargo fix
49+
--edition` multiple times with different `--target` flags if your project
50+
has platform-specific code gated by `cfg` attributes.
4851
2. Modify `Cargo.toml` to set the [edition field] to the new edition.
49-
3. Run your project tests to verify that everything still works.
52+
3. Run your project tests to verify that everything still works. If new
53+
warnings are issued, you may want to consider running `cargo fix` again
54+
(without the `--edition` flag) to apply any suggestions given by the
55+
compiler.
5056

5157
And hopefully that's it! Just keep in mind of the caveats mentioned above that
5258
`cargo fix` cannot update code for inactive features or `cfg` expressions.

src/doc/man/generated_txt/cargo-fix.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,19 @@ DESCRIPTION
4343
<https://doc.rust-lang.org/edition-guide/editions/transitioning-an-existing-project-to-a-new-edition.html>
4444
to the next. The general procedure is:
4545

46-
1. Run cargo fix --edition
46+
1. Run cargo fix --edition. Consider also using the --all-features flag
47+
if your project has multiple features. You may also want to run cargo
48+
fix --edition multiple times with different --target flags if your
49+
project has platform-specific code gated by cfg attributes.
4750

4851
2. Modify Cargo.toml to set the edition field
4952
<https://doc.rust-lang.org/cargo/reference/manifest.html#the-edition-field>
5053
to the new edition.
5154

52-
3. Run your project tests to verify that everything still works.
55+
3. Run your project tests to verify that everything still works. If new
56+
warnings are issued, you may want to consider running cargo fix again
57+
(without the --edition flag) to apply any suggestions given by the
58+
compiler.
5359

5460
And hopefully that's it! Just keep in mind of the caveats mentioned
5561
above that cargo fix cannot update code for inactive features or cfg

src/doc/src/commands/cargo-fix.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,15 @@ or feature requests please don't hesitate to file an issue at
4444
The `cargo fix` subcommand can also be used to migrate a package from one
4545
[edition] to the next. The general procedure is:
4646

47-
1. Run `cargo fix --edition`
47+
1. Run `cargo fix --edition`. Consider also using the `--all-features` flag if
48+
your project has multiple features. You may also want to run `cargo fix
49+
--edition` multiple times with different `--target` flags if your project
50+
has platform-specific code gated by `cfg` attributes.
4851
2. Modify `Cargo.toml` to set the [edition field] to the new edition.
49-
3. Run your project tests to verify that everything still works.
52+
3. Run your project tests to verify that everything still works. If new
53+
warnings are issued, you may want to consider running `cargo fix` again
54+
(without the `--edition` flag) to apply any suggestions given by the
55+
compiler.
5056

5157
And hopefully that's it! Just keep in mind of the caveats mentioned above that
5258
`cargo fix` cannot update code for inactive features or `cfg` expressions.

src/etc/man/cargo-fix.1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,20 @@ The \fBcargo fix\fR subcommand can also be used to migrate a package from one
5252
\fIedition\fR <https://doc.rust\-lang.org/edition\-guide/editions/transitioning\-an\-existing\-project\-to\-a\-new\-edition.html> to the next. The general procedure is:
5353
.sp
5454
.RS 4
55-
\h'-04' 1.\h'+01'Run \fBcargo fix \-\-edition\fR
55+
\h'-04' 1.\h'+01'Run \fBcargo fix \-\-edition\fR\&. Consider also using the \fB\-\-all\-features\fR flag if
56+
your project has multiple features. You may also want to run \fBcargo fix \-\-edition\fR multiple times with different \fB\-\-target\fR flags if your project
57+
has platform\-specific code gated by \fBcfg\fR attributes.
5658
.RE
5759
.sp
5860
.RS 4
5961
\h'-04' 2.\h'+01'Modify \fBCargo.toml\fR to set the \fIedition field\fR <https://doc.rust\-lang.org/cargo/reference/manifest.html#the\-edition\-field> to the new edition.
6062
.RE
6163
.sp
6264
.RS 4
63-
\h'-04' 3.\h'+01'Run your project tests to verify that everything still works.
65+
\h'-04' 3.\h'+01'Run your project tests to verify that everything still works. If new
66+
warnings are issued, you may want to consider running \fBcargo fix\fR again
67+
(without the \fB\-\-edition\fR flag) to apply any suggestions given by the
68+
compiler.
6469
.RE
6570
.sp
6671
And hopefully that's it! Just keep in mind of the caveats mentioned above that

0 commit comments

Comments
 (0)