Skip to content

Commit 1ee9ad2

Browse files
fixup! Adds expr_2024 migration lit
Signed-off-by: Vincenzo Palazzo <[email protected]>
1 parent d688d7d commit 1ee9ad2

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

compiler/rustc_lint/src/macro_expr_fragment_specifier_2024_migration.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ declare_lint! {
4141
///
4242
/// ### Explanation
4343
///
44-
/// Rust [editions] allow the language to evolve without breaking
45-
/// backwards compatibility. This lint catches code that uses new keywords
46-
/// that are added to the language that are used as identifiers (such as a
47-
/// variable name, function name, etc.). If you switch the compiler to a
48-
/// new edition without updating the code, then it will fail to compile if
49-
/// you are using a new keyword as an identifier.
44+
/// Rust [editions] allow the language to evolve without breaking backwards compatibility.
45+
/// This lint catches code that uses [macro matcher fragment specifiers] that have changes
46+
/// the syntax in the edition 2024. If you switch the compiler to a
47+
/// new edition without updating the code, your macros may behave differently.
48+
///
49+
/// In the edition 2024, the `expr` fragment specifier `expr`
50+
/// will also match `const { ... }` blocks. To keep the old behavior, you should use the
51+
/// `expr_2021`.
5052
///
5153
/// This lint solves the problem automatically. It is "allow" by default
5254
/// because the code is perfectly valid in older editions. The [`cargo
@@ -56,6 +58,7 @@ declare_lint! {
5658
/// a new edition.
5759
///
5860
/// [editions]: https://doc.rust-lang.org/edition-guide/
61+
/// [macro matcher fragment specifiers]: https://doc.rust-lang.org/nightly/edition-guide/rust-2024/macro-fragment-specifiers.html
5962
/// [`cargo fix`]: https://doc.rust-lang.org/cargo/commands/cargo-fix.html
6063
pub EDITION_2024_EXPR_FRAGMENT_SPECIFIER,
6164
Allow,

0 commit comments

Comments
 (0)