From 34a14349b7c79faef22d2765905c4804ba68235d Mon Sep 17 00:00:00 2001 From: Philipp Krones Date: Thu, 17 Nov 2022 19:32:28 +0100 Subject: [PATCH] Readd the matches_macro diag item This is now used by Clippy --- compiler/rustc_span/src/symbol.rs | 1 + library/core/src/macros/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index a56450a3573d1..02848bcffb298 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -893,6 +893,7 @@ symbols! { masked, match_beginning_vert, match_default_bindings, + matches_macro, maxnumf32, maxnumf64, may_dangle, diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index 34247c0584508..c20ca69a1c6f1 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -338,6 +338,7 @@ pub macro debug_assert_matches($($arg:tt)*) { /// ``` #[macro_export] #[stable(feature = "matches_macro", since = "1.42.0")] +#[cfg_attr(not(test), rustc_diagnostic_item = "matches_macro")] macro_rules! matches { ($expression:expr, $(|)? $( $pattern:pat_param )|+ $( if $guard: expr )? $(,)?) => { match $expression {