You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/rust-2024/prelude.md
+20-7Lines changed: 20 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -48,11 +48,7 @@ If in the unlikely case there is a project still using these, it is recommended
48
48
49
49
## Migration
50
50
51
-
🚧 The automatic migration for this has not yet been implemented.
52
-
53
-
### Migration needed
54
-
55
-
#### Conflicting trait methods
51
+
### Conflicting trait methods
56
52
57
53
When two traits that are in scope have the same method name, it is ambiguous which trait method should be used. For example:
58
54
@@ -74,7 +70,7 @@ fn main() {
74
70
}
75
71
```
76
72
77
-
We can fix this by using fully qualified syntax:
73
+
We can fix this so that it works on all editions by using fully qualified syntax:
78
74
79
75
```rust,ignore
80
76
fn main() {
@@ -83,7 +79,22 @@ fn main() {
83
79
}
84
80
```
85
81
86
-
#### `RustcEncodable` and `RustcDecodable`
82
+
The [`rust_2024_prelude_collisions`] lint will automatically modify any ambiguous method calls to use fully qualified syntax. This lint is part of the `rust-2024-compatibility` lint group, which will automatically be applied when running `cargo fix --edition`. To migrate your code to be Rust 2024 Edition compatible, run:
83
+
84
+
```sh
85
+
cargo fix --edition
86
+
```
87
+
88
+
Alternatively, you can manually enable the lint to find places where these qualifications need to be added:
89
+
90
+
```rust
91
+
// Add this to the root of your crate to do a manual migration.
0 commit comments