@@ -31,6 +31,7 @@ macro_rules! panic {
3131/// ```
3232#[ macro_export]
3333#[ stable( feature = "rust1" , since = "1.0.0" ) ]
34+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "assert_eq_macro" ) ]
3435#[ allow_internal_unstable( core_panic) ]
3536macro_rules! assert_eq {
3637 ( $left: expr, $right: expr $( , ) ?) => ( {
@@ -80,6 +81,7 @@ macro_rules! assert_eq {
8081/// ```
8182#[ macro_export]
8283#[ stable( feature = "assert_ne" , since = "1.13.0" ) ]
84+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "assert_ne_macro" ) ]
8385#[ allow_internal_unstable( core_panic) ]
8486macro_rules! assert_ne {
8587 ( $left: expr, $right: expr $( , ) ?) => ( {
@@ -236,6 +238,7 @@ macro_rules! debug_assert {
236238/// ```
237239 #[ macro_export]
238240#[ stable ( feature = "rust1" , since = "1.0.0" ) ]
241+ #[ cfg_attr ( not ( test) , rustc_diagnostic_item = "debug_assert_eq_macro" ) ]
239242macro_rules! debug_assert_eq {
240243 ( $( $arg: tt) * ) => ( if $crate:: cfg!( debug_assertions) { $crate:: assert_eq!( $( $arg) * ) ; } )
241244}
@@ -261,6 +264,7 @@ macro_rules! debug_assert_eq {
261264/// ```
262265#[ macro_export]
263266#[ stable( feature = "assert_ne" , since = "1.13.0" ) ]
267+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "debug_assert_ne_macro" ) ]
264268macro_rules! debug_assert_ne {
265269 ( $( $arg: tt) * ) => ( if $crate :: cfg!( debug_assertions) { $crate :: assert_ne!( $( $arg) * ) ; } )
266270}
@@ -320,6 +324,7 @@ pub macro debug_assert_matches($($arg:tt)*) {
320324/// ```
321325 #[ macro_export]
322326#[ stable( feature = "matches_macro" , since = "1.42.0" ) ]
327+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "matches_macro" ) ]
323328macro_rules! matches {
324329 ( $expression: expr, $( |) ? $( $pattern: pat_param ) |+ $( if $guard: expr ) ? $( , ) ?) => {
325330 match $expression {
@@ -475,6 +480,7 @@ macro_rules! r#try {
475480/// ```
476481 #[ macro_export]
477482#[ stable( feature = "rust1" , since = "1.0.0" ) ]
483+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "write_macro" ) ]
478484macro_rules! write {
479485 ( $dst: expr, $( $arg: tt) * ) => ( $dst. write_fmt( $crate :: format_args!( $( $arg) * ) ) )
480486}
@@ -525,6 +531,7 @@ macro_rules! write {
525531/// ```
526532 #[ macro_export]
527533#[ stable( feature = "rust1" , since = "1.0.0" ) ]
534+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "writeln_macro" ) ]
528535#[ allow_internal_unstable( format_args_nl) ]
529536macro_rules! writeln {
530537 ( $dst: expr $( , ) ?) => (
@@ -589,6 +596,7 @@ macro_rules! writeln {
589596/// ```
590597 #[ macro_export]
591598#[ stable( feature = "rust1" , since = "1.0.0" ) ]
599+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "unreachable_macro" ) ]
592600#[ allow_internal_unstable( core_panic) ]
593601macro_rules! unreachable {
594602 ( ) => ( {
@@ -675,6 +683,7 @@ macro_rules! unreachable {
675683/// ```
676684 #[ macro_export]
677685#[ stable( feature = "rust1" , since = "1.0.0" ) ]
686+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "unimplemented_macro" ) ]
678687#[ allow_internal_unstable( core_panic) ]
679688macro_rules! unimplemented {
680689 ( ) => ( $crate :: panicking:: panic( "not implemented" ) ) ;
@@ -737,6 +746,7 @@ macro_rules! unimplemented {
737746/// ```
738747 #[ macro_export]
739748#[ stable( feature = "todo_macro" , since = "1.40.0" ) ]
749+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "todo_macro" ) ]
740750#[ allow_internal_unstable( core_panic) ]
741751macro_rules! todo {
742752 ( ) => ( $crate :: panicking:: panic( "not yet implemented" ) ) ;
@@ -786,6 +796,7 @@ pub(crate) mod builtin {
786796 #[ stable( feature = "compile_error_macro" , since = "1.20.0" ) ]
787797 #[ rustc_builtin_macro]
788798 #[ macro_export]
799+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "compile_error_macro" ) ]
789800 macro_rules! compile_error {
790801 ( $msg: expr $( , ) ?) => { { /* compiler built-in */ } } ;
791802 }
@@ -835,6 +846,7 @@ pub(crate) mod builtin {
835846 /// assert_eq!(s, format!("hello {}", "world"));
836847 /// ```
837848 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
849+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "format_args_macro" ) ]
838850 #[ allow_internal_unsafe]
839851 #[ allow_internal_unstable( fmt_internals) ]
840852 #[ rustc_builtin_macro]
@@ -905,6 +917,7 @@ pub(crate) mod builtin {
905917 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
906918 #[ rustc_builtin_macro]
907919 #[ macro_export]
920+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "env_macro" ) ]
908921 macro_rules! env {
909922 ( $name: expr $( , ) ?) => { { /* compiler built-in */ } } ;
910923 ( $name: expr, $error_msg: expr $( , ) ?) => { { /* compiler built-in */ } } ;
@@ -930,6 +943,7 @@ pub(crate) mod builtin {
930943 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
931944 #[ rustc_builtin_macro]
932945 #[ macro_export]
946+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "option_env_macro" ) ]
933947 macro_rules! option_env {
934948 ( $name: expr $( , ) ?) => { { /* compiler built-in */ } } ;
935949 }
@@ -1015,6 +1029,7 @@ pub(crate) mod builtin {
10151029 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
10161030 #[ rustc_builtin_macro]
10171031 #[ macro_export]
1032+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "concat_macro" ) ]
10181033 macro_rules! concat {
10191034 ( $( $e: expr) , * $( , ) ?) => { { /* compiler built-in */ } } ;
10201035 }
@@ -1040,6 +1055,7 @@ pub(crate) mod builtin {
10401055 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
10411056 #[ rustc_builtin_macro]
10421057 #[ macro_export]
1058+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "line_macro" ) ]
10431059 macro_rules! line {
10441060 ( ) => {
10451061 /* compiler built-in */
@@ -1079,6 +1095,7 @@ pub(crate) mod builtin {
10791095 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
10801096 #[ rustc_builtin_macro]
10811097 #[ macro_export]
1098+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "column_macro" ) ]
10821099 macro_rules! column {
10831100 ( ) => {
10841101 /* compiler built-in */
@@ -1104,6 +1121,7 @@ pub(crate) mod builtin {
11041121 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
11051122 #[ rustc_builtin_macro]
11061123 #[ macro_export]
1124+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "file_macro" ) ]
11071125 macro_rules! file {
11081126 ( ) => {
11091127 /* compiler built-in */
@@ -1128,6 +1146,7 @@ pub(crate) mod builtin {
11281146 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
11291147 #[ rustc_builtin_macro]
11301148 #[ macro_export]
1149+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "stringify_macro" ) ]
11311150 macro_rules! stringify {
11321151 ( $( $t: tt) * ) => {
11331152 /* compiler built-in */
@@ -1169,6 +1188,7 @@ pub(crate) mod builtin {
11691188 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
11701189 #[ rustc_builtin_macro]
11711190 #[ macro_export]
1191+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "include_str_macro" ) ]
11721192 macro_rules! include_str {
11731193 ( $file: expr $( , ) ?) => { { /* compiler built-in */ } } ;
11741194 }
@@ -1208,6 +1228,7 @@ pub(crate) mod builtin {
12081228 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
12091229 #[ rustc_builtin_macro]
12101230 #[ macro_export]
1231+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "include_bytes_macro" ) ]
12111232 macro_rules! include_bytes {
12121233 ( $file: expr $( , ) ?) => { { /* compiler built-in */ } } ;
12131234 }
@@ -1232,6 +1253,7 @@ pub(crate) mod builtin {
12321253 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
12331254 #[ rustc_builtin_macro]
12341255 #[ macro_export]
1256+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "module_path_macro" ) ]
12351257 macro_rules! module_path {
12361258 ( ) => {
12371259 /* compiler built-in */
@@ -1265,6 +1287,7 @@ pub(crate) mod builtin {
12651287 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
12661288 #[ rustc_builtin_macro]
12671289 #[ macro_export]
1290+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "cfg_macro" ) ]
12681291 macro_rules! cfg {
12691292 ( $( $cfg: tt) * ) => {
12701293 /* compiler built-in */
@@ -1315,6 +1338,7 @@ pub(crate) mod builtin {
13151338 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
13161339 #[ rustc_builtin_macro]
13171340 #[ macro_export]
1341+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "include_macro" ) ]
13181342 macro_rules! include {
13191343 ( $file: expr $( , ) ?) => { { /* compiler built-in */ } } ;
13201344 }
0 commit comments