From eeb9d937107706c55bb62a8aaff1b8cabd81b46c Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Sat, 26 Apr 2025 07:43:14 +0000 Subject: [PATCH] Update references to the `missing_fragment_specifier` lint This lint is planned to be removed in [1], but CI is failing due to linkcheck issues in the edition guide. Remove links and add a note that the lint has become an error in all editions. [1]: https://github.com/rust-lang/rust/pull/128425 --- src/rust-2024/missing-macro-fragment-specifiers.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/rust-2024/missing-macro-fragment-specifiers.md b/src/rust-2024/missing-macro-fragment-specifiers.md index 16854313..e93f881f 100644 --- a/src/rust-2024/missing-macro-fragment-specifiers.md +++ b/src/rust-2024/missing-macro-fragment-specifiers.md @@ -1,14 +1,15 @@ # Missing macro fragment specifiers -## Summary +> [!NOTE] +> `missing_fragment_specifier` was originally made a hard error only for the 2024 Edition. In the time since this edition was released, the lint has been made into a hard error for all editions. -- The [`missing_fragment_specifier`] lint is now a hard error. +## Summary -[`missing_fragment_specifier`]: ../../rustc/lints/listing/deny-by-default.html#missing-fragment-specifier +- The `missing_fragment_specifier` lint is now a hard error. ## Details -The [`missing_fragment_specifier`] lint detects a situation when an **unused** pattern in a `macro_rules!` macro definition has a meta-variable (e.g. `$e`) that is not followed by a fragment specifier (e.g. `:expr`). This is now a hard error in the 2024 Edition. +The `missing_fragment_specifier` lint detects a situation when an **unused** pattern in a `macro_rules!` macro definition has a meta-variable (e.g. `$e`) that is not followed by a fragment specifier (e.g. `:expr`). This is now a hard error in the 2024 Edition. ```rust,compile_fail macro_rules! foo { @@ -31,6 +32,6 @@ We'd like to make this a hard error in all editions, but there would be too much ## Migration -To migrate your code to the 2024 Edition, remove the unused matcher rule from the macro. The [`missing_fragment_specifier`] lint is on by default in all editions, and should alert you to macros with this issue. +To migrate your code to the 2024 Edition, remove the unused matcher rule from the macro. The `missing_fragment_specifier` lint is on by default in all editions, and should alert you to macros with this issue. There is no automatic migration for this change. We expect that this style of macro is extremely rare. The lint has been a future-incompatibility lint since Rust 1.17, a deny-by-default lint since Rust 1.20, and since Rust 1.82, it has warned about dependencies that are using this pattern.