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" ) ]
@@ -581,8 +576,7 @@ impl Copy for () {
581
576
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
582
577
mod prim_pointer { }
583
578
584
- #[ cfg_attr( bootstrap, doc( primitive = "array" ) ) ]
585
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "array" ) ]
579
+ #[ rustc_doc_primitive = "array" ]
586
580
#[ doc( alias = "[]" ) ]
587
581
#[ doc( alias = "[T;N]" ) ] // unfortunately, rustdoc doesn't have fuzzy search for aliases
588
582
#[ doc( alias = "[T; N]" ) ]
@@ -783,8 +777,7 @@ mod prim_pointer {}
783
777
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
784
778
mod prim_array { }
785
779
786
- #[ cfg_attr( bootstrap, doc( primitive = "slice" ) ) ]
787
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "slice" ) ]
780
+ #[ rustc_doc_primitive = "slice" ]
788
781
#[ doc( alias = "[" ) ]
789
782
#[ doc( alias = "]" ) ]
790
783
#[ doc( alias = "[]" ) ]
@@ -876,8 +869,7 @@ mod prim_array {}
876
869
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
877
870
mod prim_slice { }
878
871
879
- #[ cfg_attr( bootstrap, doc( primitive = "str" ) ) ]
880
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "str" ) ]
872
+ #[ rustc_doc_primitive = "str" ]
881
873
/// String slices.
882
874
///
883
875
/// *[See also the `std::str` module](crate::str).*
@@ -944,8 +936,7 @@ mod prim_slice {}
944
936
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
945
937
mod prim_str { }
946
938
947
- #[ cfg_attr( bootstrap, doc( primitive = "tuple" ) ) ]
948
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "tuple" ) ]
939
+ #[ rustc_doc_primitive = "tuple" ]
949
940
#[ doc( alias = "(" ) ]
950
941
#[ doc( alias = ")" ) ]
951
942
#[ doc( alias = "()" ) ]
@@ -1088,8 +1079,7 @@ impl<T: Copy> Copy for (T,) {
1088
1079
// empty
1089
1080
}
1090
1081
1091
- #[ cfg_attr( bootstrap, doc( primitive = "f32" ) ) ]
1092
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "f32" ) ]
1082
+ #[ rustc_doc_primitive = "f32" ]
1093
1083
/// A 32-bit floating point type (specifically, the "binary32" type defined in IEEE 754-2008).
1094
1084
///
1095
1085
/// This type can represent a wide range of decimal numbers, like `3.5`, `27`,
@@ -1155,8 +1145,7 @@ impl<T: Copy> Copy for (T,) {
1155
1145
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1156
1146
mod prim_f32 { }
1157
1147
1158
- #[ cfg_attr( bootstrap, doc( primitive = "f64" ) ) ]
1159
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "f64" ) ]
1148
+ #[ rustc_doc_primitive = "f64" ]
1160
1149
/// A 64-bit floating point type (specifically, the "binary64" type defined in IEEE 754-2008).
1161
1150
///
1162
1151
/// This type is very similar to [`f32`], but has increased
@@ -1171,78 +1160,67 @@ mod prim_f32 {}
1171
1160
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1172
1161
mod prim_f64 { }
1173
1162
1174
- #[ cfg_attr( bootstrap, doc( primitive = "i8" ) ) ]
1175
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i8" ) ]
1163
+ #[ rustc_doc_primitive = "i8" ]
1176
1164
//
1177
1165
/// The 8-bit signed integer type.
1178
1166
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1179
1167
mod prim_i8 { }
1180
1168
1181
- #[ cfg_attr( bootstrap, doc( primitive = "i16" ) ) ]
1182
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i16" ) ]
1169
+ #[ rustc_doc_primitive = "i16" ]
1183
1170
//
1184
1171
/// The 16-bit signed integer type.
1185
1172
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1186
1173
mod prim_i16 { }
1187
1174
1188
- #[ cfg_attr( bootstrap, doc( primitive = "i32" ) ) ]
1189
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i32" ) ]
1175
+ #[ rustc_doc_primitive = "i32" ]
1190
1176
//
1191
1177
/// The 32-bit signed integer type.
1192
1178
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1193
1179
mod prim_i32 { }
1194
1180
1195
- #[ cfg_attr( bootstrap, doc( primitive = "i64" ) ) ]
1196
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i64" ) ]
1181
+ #[ rustc_doc_primitive = "i64" ]
1197
1182
//
1198
1183
/// The 64-bit signed integer type.
1199
1184
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1200
1185
mod prim_i64 { }
1201
1186
1202
- #[ cfg_attr( bootstrap, doc( primitive = "i128" ) ) ]
1203
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i128" ) ]
1187
+ #[ rustc_doc_primitive = "i128" ]
1204
1188
//
1205
1189
/// The 128-bit signed integer type.
1206
1190
#[ stable( feature = "i128" , since = "1.26.0" ) ]
1207
1191
mod prim_i128 { }
1208
1192
1209
- #[ cfg_attr( bootstrap, doc( primitive = "u8" ) ) ]
1210
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u8" ) ]
1193
+ #[ rustc_doc_primitive = "u8" ]
1211
1194
//
1212
1195
/// The 8-bit unsigned integer type.
1213
1196
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1214
1197
mod prim_u8 { }
1215
1198
1216
- #[ cfg_attr( bootstrap, doc( primitive = "u16" ) ) ]
1217
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u16" ) ]
1199
+ #[ rustc_doc_primitive = "u16" ]
1218
1200
//
1219
1201
/// The 16-bit unsigned integer type.
1220
1202
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1221
1203
mod prim_u16 { }
1222
1204
1223
- #[ cfg_attr( bootstrap, doc( primitive = "u32" ) ) ]
1224
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u32" ) ]
1205
+ #[ rustc_doc_primitive = "u32" ]
1225
1206
//
1226
1207
/// The 32-bit unsigned integer type.
1227
1208
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1228
1209
mod prim_u32 { }
1229
1210
1230
- #[ cfg_attr( bootstrap, doc( primitive = "u64" ) ) ]
1231
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u64" ) ]
1211
+ #[ rustc_doc_primitive = "u64" ]
1232
1212
//
1233
1213
/// The 64-bit unsigned integer type.
1234
1214
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1235
1215
mod prim_u64 { }
1236
1216
1237
- #[ cfg_attr( bootstrap, doc( primitive = "u128" ) ) ]
1238
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u128" ) ]
1217
+ #[ rustc_doc_primitive = "u128" ]
1239
1218
//
1240
1219
/// The 128-bit unsigned integer type.
1241
1220
#[ stable( feature = "i128" , since = "1.26.0" ) ]
1242
1221
mod prim_u128 { }
1243
1222
1244
- #[ cfg_attr( bootstrap, doc( primitive = "isize" ) ) ]
1245
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "isize" ) ]
1223
+ #[ rustc_doc_primitive = "isize" ]
1246
1224
//
1247
1225
/// The pointer-sized signed integer type.
1248
1226
///
@@ -1252,8 +1230,7 @@ mod prim_u128 {}
1252
1230
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1253
1231
mod prim_isize { }
1254
1232
1255
- #[ cfg_attr( bootstrap, doc( primitive = "usize" ) ) ]
1256
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "usize" ) ]
1233
+ #[ rustc_doc_primitive = "usize" ]
1257
1234
//
1258
1235
/// The pointer-sized unsigned integer type.
1259
1236
///
@@ -1263,8 +1240,7 @@ mod prim_isize {}
1263
1240
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1264
1241
mod prim_usize { }
1265
1242
1266
- #[ cfg_attr( bootstrap, doc( primitive = "reference" ) ) ]
1267
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "reference" ) ]
1243
+ #[ rustc_doc_primitive = "reference" ]
1268
1244
#[ doc( alias = "&" ) ]
1269
1245
#[ doc( alias = "&mut" ) ]
1270
1246
//
@@ -1396,8 +1372,7 @@ mod prim_usize {}
1396
1372
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1397
1373
mod prim_ref { }
1398
1374
1399
- #[ cfg_attr( bootstrap, doc( primitive = "fn" ) ) ]
1400
- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "fn" ) ]
1375
+ #[ rustc_doc_primitive = "fn" ]
1401
1376
//
1402
1377
/// Function pointers, like `fn(usize) -> bool`.
1403
1378
///
0 commit comments