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