@@ -1010,8 +1010,12 @@ pub(crate) mod builtin {
1010
1010
#[ rustc_builtin_macro]
1011
1011
#[ macro_export]
1012
1012
macro_rules! format_args {
1013
- ( $fmt: expr) => { { /* compiler built-in */ } } ;
1014
- ( $fmt: expr, $( $args: tt) * ) => { { /* compiler built-in */ } } ;
1013
+ ( $fmt: expr) => {
1014
+ $crate :: hint:: must_use( { /* compiler built-in */ } )
1015
+ } ;
1016
+ ( $fmt: expr, $( $args: tt) * ) => {
1017
+ $crate :: hint:: must_use( { /* compiler built-in */ } )
1018
+ } ;
1015
1019
}
1016
1020
1017
1021
/// Same as [`format_args`], but can be used in some const contexts.
@@ -1081,8 +1085,12 @@ pub(crate) mod builtin {
1081
1085
#[ macro_export]
1082
1086
#[ rustc_diagnostic_item = "env_macro" ] // useful for external lints
1083
1087
macro_rules! env {
1084
- ( $name: expr $( , ) ?) => { { /* compiler built-in */ } } ;
1085
- ( $name: expr, $error_msg: expr $( , ) ?) => { { /* compiler built-in */ } } ;
1088
+ ( $name: expr $( , ) ?) => {
1089
+ $crate :: hint:: must_use( { /* compiler built-in */ } )
1090
+ } ;
1091
+ ( $name: expr, $error_msg: expr $( , ) ?) => {
1092
+ $crate :: hint:: must_use( { /* compiler built-in */ } )
1093
+ } ;
1086
1094
}
1087
1095
1088
1096
/// Optionally inspects an environment variable at compile time.
@@ -1112,7 +1120,9 @@ pub(crate) mod builtin {
1112
1120
#[ macro_export]
1113
1121
#[ rustc_diagnostic_item = "option_env_macro" ] // useful for external lints
1114
1122
macro_rules! option_env {
1115
- ( $name: expr $( , ) ?) => { { /* compiler built-in */ } } ;
1123
+ ( $name: expr $( , ) ?) => {
1124
+ $crate :: hint:: must_use( { /* compiler built-in */ } )
1125
+ } ;
1116
1126
}
1117
1127
1118
1128
/// Concatenates identifiers into one identifier.
@@ -1174,7 +1184,9 @@ pub(crate) mod builtin {
1174
1184
#[ rustc_builtin_macro]
1175
1185
#[ macro_export]
1176
1186
macro_rules! concat_bytes {
1177
- ( $( $e: literal) , + $( , ) ?) => { { /* compiler built-in */ } } ;
1187
+ ( $( $e: literal) , + $( , ) ?) => {
1188
+ $crate :: hint:: must_use( { /* compiler built-in */ } )
1189
+ } ;
1178
1190
}
1179
1191
1180
1192
/// Concatenates literals into a static string slice.
@@ -1196,7 +1208,9 @@ pub(crate) mod builtin {
1196
1208
#[ rustc_builtin_macro]
1197
1209
#[ macro_export]
1198
1210
macro_rules! concat {
1199
- ( $( $e: expr) , * $( , ) ?) => { { /* compiler built-in */ } } ;
1211
+ ( $( $e: expr) , * $( , ) ?) => {
1212
+ $crate :: hint:: must_use( { /* compiler built-in */ } )
1213
+ } ;
1200
1214
}
1201
1215
1202
1216
/// Expands to the line number on which it was invoked.
@@ -1222,7 +1236,7 @@ pub(crate) mod builtin {
1222
1236
#[ macro_export]
1223
1237
macro_rules! line {
1224
1238
( ) => {
1225
- /* compiler built-in */
1239
+ $ crate :: hint :: must_use ( { /* compiler built-in */ } )
1226
1240
} ;
1227
1241
}
1228
1242
@@ -1261,7 +1275,7 @@ pub(crate) mod builtin {
1261
1275
#[ macro_export]
1262
1276
macro_rules! column {
1263
1277
( ) => {
1264
- /* compiler built-in */
1278
+ $ crate :: hint :: must_use ( /* compiler built-in */ )
1265
1279
} ;
1266
1280
}
1267
1281
@@ -1286,7 +1300,7 @@ pub(crate) mod builtin {
1286
1300
#[ macro_export]
1287
1301
macro_rules! file {
1288
1302
( ) => {
1289
- /* compiler built-in */
1303
+ $ crate :: hint :: must_use ( /* compiler built-in */ )
1290
1304
} ;
1291
1305
}
1292
1306
@@ -1310,7 +1324,7 @@ pub(crate) mod builtin {
1310
1324
#[ macro_export]
1311
1325
macro_rules! stringify {
1312
1326
( $( $t: tt) * ) => {
1313
- /* compiler built-in */
1327
+ $ crate :: hint :: must_use ( /* compiler built-in */ )
1314
1328
} ;
1315
1329
}
1316
1330
@@ -1351,7 +1365,9 @@ pub(crate) mod builtin {
1351
1365
#[ macro_export]
1352
1366
#[ cfg_attr( not( test) , rustc_diagnostic_item = "include_str_macro" ) ]
1353
1367
macro_rules! include_str {
1354
- ( $file: expr $( , ) ?) => { { /* compiler built-in */ } } ;
1368
+ ( $file: expr $( , ) ?) => {
1369
+ $crate :: hint:: must_use( { /* compiler built-in */ } )
1370
+ } ;
1355
1371
}
1356
1372
1357
1373
/// Includes a file as a reference to a byte array.
@@ -1391,7 +1407,9 @@ pub(crate) mod builtin {
1391
1407
#[ macro_export]
1392
1408
#[ cfg_attr( not( test) , rustc_diagnostic_item = "include_bytes_macro" ) ]
1393
1409
macro_rules! include_bytes {
1394
- ( $file: expr $( , ) ?) => { { /* compiler built-in */ } } ;
1410
+ ( $file: expr $( , ) ?) => {
1411
+ $crate :: hint:: must_use( { /* compiler built-in */ } )
1412
+ } ;
1395
1413
}
1396
1414
1397
1415
/// Expands to a string that represents the current module path.
@@ -1449,7 +1467,7 @@ pub(crate) mod builtin {
1449
1467
#[ macro_export]
1450
1468
macro_rules! cfg {
1451
1469
( $( $cfg: tt) * ) => {
1452
- /* compiler built-in */
1470
+ $ crate :: hint :: must_use ( /* compiler built-in */ )
1453
1471
} ;
1454
1472
}
1455
1473
0 commit comments