1
1
// `library/{std,core}/src/primitive_docs.rs` should have the same contents.
2
2
// These are different files so that relative links work properly without
3
3
// having to have `CARGO_PKG_NAME` set, but conceptually they should always be the same.
4
- #[ cfg_attr( bootstrap, doc( primitive = "bool" ) ) ]
5
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "bool" ) ]
4
+ #[ rustc_doc_primitive = "bool" ]
6
5
#[ doc( alias = "true" ) ]
7
6
#[ doc( alias = "false" ) ]
8
7
/// The boolean type.
64
63
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
65
64
mod prim_bool { }
66
65
67
- #[ cfg_attr( bootstrap, doc( primitive = "never" ) ) ]
68
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "never" ) ]
66
+ #[ rustc_doc_primitive = "never" ]
69
67
#[ doc( alias = "!" ) ]
70
68
//
71
69
/// The `!` type, also called "never".
@@ -276,8 +274,7 @@ mod prim_bool {}
276
274
#[ unstable( feature = "never_type" , issue = "35121" ) ]
277
275
mod prim_never { }
278
276
279
- #[ cfg_attr( bootstrap, doc( primitive = "char" ) ) ]
280
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "char" ) ]
277
+ #[ rustc_doc_primitive = "char" ]
281
278
#[ allow( rustdoc:: invalid_rust_codeblocks) ]
282
279
/// A character type.
283
280
///
@@ -401,8 +398,7 @@ mod prim_never {}
401
398
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
402
399
mod prim_char { }
403
400
404
- #[ cfg_attr( bootstrap, doc( primitive = "unit" ) ) ]
405
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "unit" ) ]
401
+ #[ rustc_doc_primitive = "unit" ]
406
402
#[ doc( alias = "(" ) ]
407
403
#[ doc( alias = ")" ) ]
408
404
#[ doc( alias = "()" ) ]
@@ -464,8 +460,7 @@ impl Copy for () {
464
460
// empty
465
461
}
466
462
467
- #[ cfg_attr( bootstrap, doc( primitive = "pointer" ) ) ]
468
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "pointer" ) ]
463
+ #[ rustc_doc_primitive = "pointer" ]
469
464
#[ doc( alias = "ptr" ) ]
470
465
#[ doc( alias = "*" ) ]
471
466
#[ doc( alias = "*const" ) ]
@@ -582,8 +577,7 @@ impl Copy for () {
582
577
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
583
578
mod prim_pointer { }
584
579
585
- #[ cfg_attr( bootstrap, doc( primitive = "array" ) ) ]
586
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "array" ) ]
580
+ #[ rustc_doc_primitive = "array" ]
587
581
#[ doc( alias = "[]" ) ]
588
582
#[ doc( alias = "[T;N]" ) ] // unfortunately, rustdoc doesn't have fuzzy search for aliases
589
583
#[ doc( alias = "[T; N]" ) ]
@@ -784,8 +778,7 @@ mod prim_pointer {}
784
778
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
785
779
mod prim_array { }
786
780
787
- #[ cfg_attr( bootstrap, doc( primitive = "slice" ) ) ]
788
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "slice" ) ]
781
+ #[ rustc_doc_primitive = "slice" ]
789
782
#[ doc( alias = "[" ) ]
790
783
#[ doc( alias = "]" ) ]
791
784
#[ doc( alias = "[]" ) ]
@@ -877,8 +870,7 @@ mod prim_array {}
877
870
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
878
871
mod prim_slice { }
879
872
880
- #[ cfg_attr( bootstrap, doc( primitive = "str" ) ) ]
881
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "str" ) ]
873
+ #[ rustc_doc_primitive = "str" ]
882
874
/// String slices.
883
875
///
884
876
/// *[See also the `std::str` module](crate::str).*
@@ -945,8 +937,7 @@ mod prim_slice {}
945
937
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
946
938
mod prim_str { }
947
939
948
- #[ cfg_attr( bootstrap, doc( primitive = "tuple" ) ) ]
949
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "tuple" ) ]
940
+ #[ rustc_doc_primitive = "tuple" ]
950
941
#[ doc( alias = "(" ) ]
951
942
#[ doc( alias = ")" ) ]
952
943
#[ doc( alias = "()" ) ]
@@ -1090,8 +1081,7 @@ impl<T: Copy> Copy for (T,) {
1090
1081
// empty
1091
1082
}
1092
1083
1093
- #[ cfg_attr( bootstrap, doc( primitive = "f32" ) ) ]
1094
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "f32" ) ]
1084
+ #[ rustc_doc_primitive = "f32" ]
1095
1085
/// A 32-bit floating point type (specifically, the "binary32" type defined in IEEE 754-2008).
1096
1086
///
1097
1087
/// This type can represent a wide range of decimal numbers, like `3.5`, `27`,
@@ -1157,8 +1147,7 @@ impl<T: Copy> Copy for (T,) {
1157
1147
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1158
1148
mod prim_f32 { }
1159
1149
1160
- #[ cfg_attr( bootstrap, doc( primitive = "f64" ) ) ]
1161
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "f64" ) ]
1150
+ #[ rustc_doc_primitive = "f64" ]
1162
1151
/// A 64-bit floating point type (specifically, the "binary64" type defined in IEEE 754-2008).
1163
1152
///
1164
1153
/// This type is very similar to [`f32`], but has increased
@@ -1173,78 +1162,67 @@ mod prim_f32 {}
1173
1162
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1174
1163
mod prim_f64 { }
1175
1164
1176
- #[ cfg_attr( bootstrap, doc( primitive = "i8" ) ) ]
1177
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i8" ) ]
1165
+ #[ rustc_doc_primitive = "i8" ]
1178
1166
//
1179
1167
/// The 8-bit signed integer type.
1180
1168
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1181
1169
mod prim_i8 { }
1182
1170
1183
- #[ cfg_attr( bootstrap, doc( primitive = "i16" ) ) ]
1184
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i16" ) ]
1171
+ #[ rustc_doc_primitive = "i16" ]
1185
1172
//
1186
1173
/// The 16-bit signed integer type.
1187
1174
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1188
1175
mod prim_i16 { }
1189
1176
1190
- #[ cfg_attr( bootstrap, doc( primitive = "i32" ) ) ]
1191
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i32" ) ]
1177
+ #[ rustc_doc_primitive = "i32" ]
1192
1178
//
1193
1179
/// The 32-bit signed integer type.
1194
1180
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1195
1181
mod prim_i32 { }
1196
1182
1197
- #[ cfg_attr( bootstrap, doc( primitive = "i64" ) ) ]
1198
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i64" ) ]
1183
+ #[ rustc_doc_primitive = "i64" ]
1199
1184
//
1200
1185
/// The 64-bit signed integer type.
1201
1186
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1202
1187
mod prim_i64 { }
1203
1188
1204
- #[ cfg_attr( bootstrap, doc( primitive = "i128" ) ) ]
1205
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i128" ) ]
1189
+ #[ rustc_doc_primitive = "i128" ]
1206
1190
//
1207
1191
/// The 128-bit signed integer type.
1208
1192
#[ stable( feature = "i128" , since = "1.26.0" ) ]
1209
1193
mod prim_i128 { }
1210
1194
1211
- #[ cfg_attr( bootstrap, doc( primitive = "u8" ) ) ]
1212
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u8" ) ]
1195
+ #[ rustc_doc_primitive = "u8" ]
1213
1196
//
1214
1197
/// The 8-bit unsigned integer type.
1215
1198
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1216
1199
mod prim_u8 { }
1217
1200
1218
- #[ cfg_attr( bootstrap, doc( primitive = "u16" ) ) ]
1219
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u16" ) ]
1201
+ #[ rustc_doc_primitive = "u16" ]
1220
1202
//
1221
1203
/// The 16-bit unsigned integer type.
1222
1204
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1223
1205
mod prim_u16 { }
1224
1206
1225
- #[ cfg_attr( bootstrap, doc( primitive = "u32" ) ) ]
1226
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u32" ) ]
1207
+ #[ rustc_doc_primitive = "u32" ]
1227
1208
//
1228
1209
/// The 32-bit unsigned integer type.
1229
1210
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1230
1211
mod prim_u32 { }
1231
1212
1232
- #[ cfg_attr( bootstrap, doc( primitive = "u64" ) ) ]
1233
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u64" ) ]
1213
+ #[ rustc_doc_primitive = "u64" ]
1234
1214
//
1235
1215
/// The 64-bit unsigned integer type.
1236
1216
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1237
1217
mod prim_u64 { }
1238
1218
1239
- #[ cfg_attr( bootstrap, doc( primitive = "u128" ) ) ]
1240
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u128" ) ]
1219
+ #[ rustc_doc_primitive = "u128" ]
1241
1220
//
1242
1221
/// The 128-bit unsigned integer type.
1243
1222
#[ stable( feature = "i128" , since = "1.26.0" ) ]
1244
1223
mod prim_u128 { }
1245
1224
1246
- #[ cfg_attr( bootstrap, doc( primitive = "isize" ) ) ]
1247
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "isize" ) ]
1225
+ #[ rustc_doc_primitive = "isize" ]
1248
1226
//
1249
1227
/// The pointer-sized signed integer type.
1250
1228
///
@@ -1254,8 +1232,7 @@ mod prim_u128 {}
1254
1232
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1255
1233
mod prim_isize { }
1256
1234
1257
- #[ cfg_attr( bootstrap, doc( primitive = "usize" ) ) ]
1258
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "usize" ) ]
1235
+ #[ rustc_doc_primitive = "usize" ]
1259
1236
//
1260
1237
/// The pointer-sized unsigned integer type.
1261
1238
///
@@ -1265,8 +1242,7 @@ mod prim_isize {}
1265
1242
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1266
1243
mod prim_usize { }
1267
1244
1268
- #[ cfg_attr( bootstrap, doc( primitive = "reference" ) ) ]
1269
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "reference" ) ]
1245
+ #[ rustc_doc_primitive = "reference" ]
1270
1246
#[ doc( alias = "&" ) ]
1271
1247
#[ doc( alias = "&mut" ) ]
1272
1248
//
@@ -1397,8 +1373,7 @@ mod prim_usize {}
1397
1373
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1398
1374
mod prim_ref { }
1399
1375
1400
- #[ cfg_attr( bootstrap, doc( primitive = "fn" ) ) ]
1401
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "fn" ) ]
1376
+ #[ rustc_doc_primitive = "fn" ]
1402
1377
//
1403
1378
/// Function pointers, like `fn(usize) -> bool`.
1404
1379
///
0 commit comments