@@ -37,7 +37,7 @@ macro_rules! panic {
3737/// ```
3838#[ macro_export]
3939#[ stable( feature = "rust1" , since = "1.0.0" ) ]
40- #[ cfg_attr( not( test) , rustc_diagnostic_item = "assert_eq_macro" ) ]
40+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "assert_eq_macro" , clippy :: format_args ) ]
4141#[ allow_internal_unstable( panic_internals) ]
4242macro_rules! assert_eq {
4343 ( $left: expr, $right: expr $( , ) ?) => {
@@ -93,7 +93,7 @@ macro_rules! assert_eq {
9393/// ```
9494#[ macro_export]
9595#[ stable( feature = "assert_ne" , since = "1.13.0" ) ]
96- #[ cfg_attr( not( test) , rustc_diagnostic_item = "assert_ne_macro" ) ]
96+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "assert_ne_macro" , clippy :: format_args ) ]
9797#[ allow_internal_unstable( panic_internals) ]
9898macro_rules! assert_ne {
9999 ( $left: expr, $right: expr $( , ) ?) => {
@@ -169,6 +169,7 @@ macro_rules! assert_ne {
169169#[ unstable( feature = "assert_matches" , issue = "82775" ) ]
170170#[ allow_internal_unstable( panic_internals) ]
171171#[ rustc_macro_transparency = "semitransparent" ]
172+ #[ cfg_attr( not( test) , clippy:: format_args) ]
172173pub macro assert_matches {
173174 ( $left: expr, $( |) ? $( $pattern: pat_param ) |+ $( if $guard: expr ) ? $( , ) ?) => {
174175 match $left {
@@ -392,6 +393,7 @@ pub macro cfg_match {
392393#[ stable ( feature = "rust1" , since = "1.0.0" ) ]
393394#[ rustc_diagnostic_item = "debug_assert_macro" ]
394395#[ allow_internal_unstable ( edition_panic) ]
396+ #[ cfg_attr ( not ( test) , clippy:: format_args) ]
395397macro_rules! debug_assert {
396398 ( $( $arg: tt) * ) => {
397399 if $crate :: cfg!( debug_assertions) {
@@ -421,7 +423,7 @@ macro_rules! debug_assert {
421423/// ```
422424 #[ macro_export]
423425#[ stable( feature = "rust1" , since = "1.0.0" ) ]
424- #[ cfg_attr( not( test) , rustc_diagnostic_item = "debug_assert_eq_macro" ) ]
426+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "debug_assert_eq_macro" , clippy :: format_args ) ]
425427macro_rules! debug_assert_eq {
426428 ( $( $arg: tt) * ) => {
427429 if $crate :: cfg!( debug_assertions) {
@@ -451,7 +453,7 @@ macro_rules! debug_assert_eq {
451453/// ```
452454 #[ macro_export]
453455#[ stable( feature = "assert_ne" , since = "1.13.0" ) ]
454- #[ cfg_attr( not( test) , rustc_diagnostic_item = "debug_assert_ne_macro" ) ]
456+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "debug_assert_ne_macro" , clippy :: format_args ) ]
455457macro_rules! debug_assert_ne {
456458 ( $( $arg: tt) * ) => {
457459 if $crate :: cfg!( debug_assertions) {
@@ -707,7 +709,7 @@ macro_rules! r#try {
707709/// ```
708710 #[ macro_export]
709711#[ stable( feature = "rust1" , since = "1.0.0" ) ]
710- #[ cfg_attr( not( test) , rustc_diagnostic_item = "write_macro" ) ]
712+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "write_macro" , clippy :: format_args ) ]
711713macro_rules! write {
712714 ( $dst: expr, $( $arg: tt) * ) => {
713715 $dst. write_fmt( $crate :: format_args!( $( $arg) * ) )
@@ -741,7 +743,7 @@ macro_rules! write {
741743/// ```
742744 #[ macro_export]
743745#[ stable( feature = "rust1" , since = "1.0.0" ) ]
744- #[ cfg_attr( not( test) , rustc_diagnostic_item = "writeln_macro" ) ]
746+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "writeln_macro" , clippy :: format_args ) ]
745747#[ allow_internal_unstable( format_args_nl) ]
746748macro_rules! writeln {
747749 ( $dst: expr $( , ) ?) => {
@@ -895,6 +897,7 @@ macro_rules! unreachable {
895897#[ stable( feature = "rust1" , since = "1.0.0" ) ]
896898#[ cfg_attr( not( test) , rustc_diagnostic_item = "unimplemented_macro" ) ]
897899#[ allow_internal_unstable( panic_internals) ]
900+ #[ clippy:: format_args]
898901macro_rules! unimplemented {
899902 ( ) => {
900903 $crate :: panicking:: panic( "not implemented" )
@@ -973,7 +976,7 @@ macro_rules! unimplemented {
973976/// ```
974977 #[ macro_export]
975978#[ stable( feature = "todo_macro" , since = "1.40.0" ) ]
976- #[ cfg_attr( not( test) , rustc_diagnostic_item = "todo_macro" ) ]
979+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "todo_macro" , clippy :: format_args ) ]
977980#[ allow_internal_unstable( panic_internals) ]
978981macro_rules! todo {
979982 ( ) => {
@@ -1085,7 +1088,7 @@ pub(crate) mod builtin {
10851088 /// and cannot be stored for later use.
10861089 /// This is a known limitation, see [#92698](https://github.com/rust-lang/rust/issues/92698).
10871090 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1088- #[ cfg_attr( not( test) , rustc_diagnostic_item = "format_args_macro" ) ]
1091+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "format_args_macro" , clippy :: format_args ) ]
10891092 #[ allow_internal_unsafe]
10901093 #[ allow_internal_unstable( fmt_internals) ]
10911094 #[ rustc_builtin_macro]
@@ -1675,6 +1678,7 @@ pub(crate) mod builtin {
16751678 edition_panic,
16761679 generic_assert_internals
16771680 ) ]
1681+ #[ cfg_attr( not( test) , clippy:: format_args) ]
16781682 macro_rules! assert {
16791683 ( $cond: expr $( , ) ?) => { { /* compiler built-in */ } } ;
16801684 ( $cond: expr, $( $arg: tt) +) => { { /* compiler built-in */ } } ;
0 commit comments