Skip to content

Commit 1ce3a24

Browse files
ehusstraviscross
authored andcommitted
Recommend updating dependencies
1 parent 06ff078 commit 1ce3a24

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/editions/transitioning-an-existing-project-to-a-new-edition.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ Rust includes tooling to automatically transition a project from one edition to
44
It will update your source code so that it is compatible with the next edition.
55
Briefly, the steps to update to the next edition are:
66

7-
1. Run `cargo fix --edition`
8-
2. Edit `Cargo.toml` and set the `edition` field to the next edition, for example `edition = "2024"`
9-
3. Run `cargo build` or `cargo test` to verify the fixes worked.
7+
1. Run `cargo update` to update your dependencies to the latest versions.
8+
2. Run `cargo fix --edition`
9+
3. Edit `Cargo.toml` and set the `edition` field to the next edition, for example `edition = "2024"`
10+
4. Run `cargo build` or `cargo test` to verify the fixes worked.
1011

1112
The following sections dig into the details of these steps, and some of the issues you may encounter along the way.
1213

@@ -32,6 +33,16 @@ This code uses an anonymous parameter, that `i32`. This is [not
3233
supported in Rust 2018](../rust-2018/trait-system/no-anon-params.md), and
3334
so this would fail to compile. Let's get this code up to date!
3435

36+
## Updating your dependencies
37+
38+
Before we get started, it is recommended to update your dependencies. Some dependencies, particularly some proc-macros or dependencies that do build-time code generation, may have compatibility issues with newer editions. New releases may have been made since you last updated which may fix these issues. Run the following:
39+
40+
```console
41+
cargo update
42+
```
43+
44+
After updating, you may want to run your tests to verify everything is working. If you are using a source control tool such as `git`, you may want to commit these changes separately to keep a logical separation of commits.
45+
3546
## Updating your code to be compatible with the new edition
3647

3748
Your code may or may not use features that are incompatible with the new edition.

0 commit comments

Comments
 (0)