Skip to content

Commit

Permalink
fixup! Adds expr_2024 migration lit
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Jul 9, 2024
1 parent d688d7d commit 1ee9ad2
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ declare_lint! {
///
/// ### Explanation
///
/// Rust [editions] allow the language to evolve without breaking
/// backwards compatibility. This lint catches code that uses new keywords
/// that are added to the language that are used as identifiers (such as a
/// variable name, function name, etc.). If you switch the compiler to a
/// new edition without updating the code, then it will fail to compile if
/// you are using a new keyword as an identifier.
/// Rust [editions] allow the language to evolve without breaking backwards compatibility.
/// This lint catches code that uses [macro matcher fragment specifiers] that have changes
/// the syntax in the edition 2024. If you switch the compiler to a
/// new edition without updating the code, your macros may behave differently.
///
/// In the edition 2024, the `expr` fragment specifier `expr`
/// will also match `const { ... }` blocks. To keep the old behavior, you should use the
/// `expr_2021`.
///
/// This lint solves the problem automatically. It is "allow" by default
/// because the code is perfectly valid in older editions. The [`cargo
Expand All @@ -56,6 +58,7 @@ declare_lint! {
/// a new edition.
///
/// [editions]: https://doc.rust-lang.org/edition-guide/
/// [macro matcher fragment specifiers]: https://doc.rust-lang.org/nightly/edition-guide/rust-2024/macro-fragment-specifiers.html
/// [`cargo fix`]: https://doc.rust-lang.org/cargo/commands/cargo-fix.html
pub EDITION_2024_EXPR_FRAGMENT_SPECIFIER,
Allow,
Expand Down

0 comments on commit 1ee9ad2

Please sign in to comment.