Skip to content

Commit 2a44ae0

Browse files
committed
Add section on lint and cargo fix
1 parent 006b8b5 commit 2a44ae0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/rust-2021/or-patterns-macro-rules.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ change how the macro works.
3636

3737
## Migration to Rust 2021
3838

39+
A lint, `rust_2021_incompatible_or_patterns`, gets triggered whenever there is a use `$:_pat` which
40+
will change meaning in Rust 2021.
41+
42+
You can automatically migrate your code to be Rust 2021 Edition compatible or ensure it is already compatible by
43+
running:
44+
45+
```sh
46+
cargo fix --edition
47+
```
48+
3949
If you have a macro which relies on `$_:pat` not matching the top level use of `|` in patterns,
4050
you'll need to change each occurrence of `$_:pat` to `$_:pat_param`.
4151

0 commit comments

Comments
 (0)