11// `library/{std,core}/src/primitive_docs.rs` should have the same contents.
22// These are different files so that relative links work properly without
33// 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" ]
65#[ doc( alias = "true" ) ]
76#[ doc( alias = "false" ) ]
87/// The boolean type.
6463#[ stable( feature = "rust1" , since = "1.0.0" ) ]
6564mod prim_bool { }
6665
67- #[ cfg_attr( bootstrap, doc( primitive = "never" ) ) ]
68- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "never" ) ]
66+ #[ rustc_doc_primitive = "never" ]
6967#[ doc( alias = "!" ) ]
7068//
7169/// The `!` type, also called "never".
@@ -276,8 +274,7 @@ mod prim_bool {}
276274#[ unstable( feature = "never_type" , issue = "35121" ) ]
277275mod prim_never { }
278276
279- #[ cfg_attr( bootstrap, doc( primitive = "char" ) ) ]
280- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "char" ) ]
277+ #[ rustc_doc_primitive = "char" ]
281278#[ allow( rustdoc:: invalid_rust_codeblocks) ]
282279/// A character type.
283280///
@@ -401,8 +398,7 @@ mod prim_never {}
401398#[ stable( feature = "rust1" , since = "1.0.0" ) ]
402399mod prim_char { }
403400
404- #[ cfg_attr( bootstrap, doc( primitive = "unit" ) ) ]
405- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "unit" ) ]
401+ #[ rustc_doc_primitive = "unit" ]
406402#[ doc( alias = "(" ) ]
407403#[ doc( alias = ")" ) ]
408404#[ doc( alias = "()" ) ]
@@ -464,8 +460,7 @@ impl Copy for () {
464460 // empty
465461}
466462
467- #[ cfg_attr( bootstrap, doc( primitive = "pointer" ) ) ]
468- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "pointer" ) ]
463+ #[ rustc_doc_primitive = "pointer" ]
469464#[ doc( alias = "ptr" ) ]
470465#[ doc( alias = "*" ) ]
471466#[ doc( alias = "*const" ) ]
@@ -582,8 +577,7 @@ impl Copy for () {
582577#[ stable( feature = "rust1" , since = "1.0.0" ) ]
583578mod prim_pointer { }
584579
585- #[ cfg_attr( bootstrap, doc( primitive = "array" ) ) ]
586- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "array" ) ]
580+ #[ rustc_doc_primitive = "array" ]
587581#[ doc( alias = "[]" ) ]
588582#[ doc( alias = "[T;N]" ) ] // unfortunately, rustdoc doesn't have fuzzy search for aliases
589583#[ doc( alias = "[T; N]" ) ]
@@ -784,8 +778,7 @@ mod prim_pointer {}
784778#[ stable( feature = "rust1" , since = "1.0.0" ) ]
785779mod prim_array { }
786780
787- #[ cfg_attr( bootstrap, doc( primitive = "slice" ) ) ]
788- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "slice" ) ]
781+ #[ rustc_doc_primitive = "slice" ]
789782#[ doc( alias = "[" ) ]
790783#[ doc( alias = "]" ) ]
791784#[ doc( alias = "[]" ) ]
@@ -877,8 +870,7 @@ mod prim_array {}
877870#[ stable( feature = "rust1" , since = "1.0.0" ) ]
878871mod prim_slice { }
879872
880- #[ cfg_attr( bootstrap, doc( primitive = "str" ) ) ]
881- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "str" ) ]
873+ #[ rustc_doc_primitive = "str" ]
882874/// String slices.
883875///
884876/// *[See also the `std::str` module](crate::str).*
@@ -945,8 +937,7 @@ mod prim_slice {}
945937#[ stable( feature = "rust1" , since = "1.0.0" ) ]
946938mod prim_str { }
947939
948- #[ cfg_attr( bootstrap, doc( primitive = "tuple" ) ) ]
949- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "tuple" ) ]
940+ #[ rustc_doc_primitive = "tuple" ]
950941#[ doc( alias = "(" ) ]
951942#[ doc( alias = ")" ) ]
952943#[ doc( alias = "()" ) ]
@@ -1090,8 +1081,7 @@ impl<T: Copy> Copy for (T,) {
10901081 // empty
10911082}
10921083
1093- #[ cfg_attr( bootstrap, doc( primitive = "f32" ) ) ]
1094- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "f32" ) ]
1084+ #[ rustc_doc_primitive = "f32" ]
10951085/// A 32-bit floating point type (specifically, the "binary32" type defined in IEEE 754-2008).
10961086///
10971087/// This type can represent a wide range of decimal numbers, like `3.5`, `27`,
@@ -1157,8 +1147,7 @@ impl<T: Copy> Copy for (T,) {
11571147#[ stable( feature = "rust1" , since = "1.0.0" ) ]
11581148mod prim_f32 { }
11591149
1160- #[ cfg_attr( bootstrap, doc( primitive = "f64" ) ) ]
1161- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "f64" ) ]
1150+ #[ rustc_doc_primitive = "f64" ]
11621151/// A 64-bit floating point type (specifically, the "binary64" type defined in IEEE 754-2008).
11631152///
11641153/// This type is very similar to [`f32`], but has increased
@@ -1173,78 +1162,67 @@ mod prim_f32 {}
11731162#[ stable( feature = "rust1" , since = "1.0.0" ) ]
11741163mod prim_f64 { }
11751164
1176- #[ cfg_attr( bootstrap, doc( primitive = "i8" ) ) ]
1177- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i8" ) ]
1165+ #[ rustc_doc_primitive = "i8" ]
11781166//
11791167/// The 8-bit signed integer type.
11801168#[ stable( feature = "rust1" , since = "1.0.0" ) ]
11811169mod prim_i8 { }
11821170
1183- #[ cfg_attr( bootstrap, doc( primitive = "i16" ) ) ]
1184- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i16" ) ]
1171+ #[ rustc_doc_primitive = "i16" ]
11851172//
11861173/// The 16-bit signed integer type.
11871174#[ stable( feature = "rust1" , since = "1.0.0" ) ]
11881175mod prim_i16 { }
11891176
1190- #[ cfg_attr( bootstrap, doc( primitive = "i32" ) ) ]
1191- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i32" ) ]
1177+ #[ rustc_doc_primitive = "i32" ]
11921178//
11931179/// The 32-bit signed integer type.
11941180#[ stable( feature = "rust1" , since = "1.0.0" ) ]
11951181mod prim_i32 { }
11961182
1197- #[ cfg_attr( bootstrap, doc( primitive = "i64" ) ) ]
1198- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i64" ) ]
1183+ #[ rustc_doc_primitive = "i64" ]
11991184//
12001185/// The 64-bit signed integer type.
12011186#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12021187mod prim_i64 { }
12031188
1204- #[ cfg_attr( bootstrap, doc( primitive = "i128" ) ) ]
1205- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i128" ) ]
1189+ #[ rustc_doc_primitive = "i128" ]
12061190//
12071191/// The 128-bit signed integer type.
12081192#[ stable( feature = "i128" , since = "1.26.0" ) ]
12091193mod prim_i128 { }
12101194
1211- #[ cfg_attr( bootstrap, doc( primitive = "u8" ) ) ]
1212- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u8" ) ]
1195+ #[ rustc_doc_primitive = "u8" ]
12131196//
12141197/// The 8-bit unsigned integer type.
12151198#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12161199mod prim_u8 { }
12171200
1218- #[ cfg_attr( bootstrap, doc( primitive = "u16" ) ) ]
1219- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u16" ) ]
1201+ #[ rustc_doc_primitive = "u16" ]
12201202//
12211203/// The 16-bit unsigned integer type.
12221204#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12231205mod prim_u16 { }
12241206
1225- #[ cfg_attr( bootstrap, doc( primitive = "u32" ) ) ]
1226- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u32" ) ]
1207+ #[ rustc_doc_primitive = "u32" ]
12271208//
12281209/// The 32-bit unsigned integer type.
12291210#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12301211mod prim_u32 { }
12311212
1232- #[ cfg_attr( bootstrap, doc( primitive = "u64" ) ) ]
1233- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u64" ) ]
1213+ #[ rustc_doc_primitive = "u64" ]
12341214//
12351215/// The 64-bit unsigned integer type.
12361216#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12371217mod prim_u64 { }
12381218
1239- #[ cfg_attr( bootstrap, doc( primitive = "u128" ) ) ]
1240- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u128" ) ]
1219+ #[ rustc_doc_primitive = "u128" ]
12411220//
12421221/// The 128-bit unsigned integer type.
12431222#[ stable( feature = "i128" , since = "1.26.0" ) ]
12441223mod prim_u128 { }
12451224
1246- #[ cfg_attr( bootstrap, doc( primitive = "isize" ) ) ]
1247- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "isize" ) ]
1225+ #[ rustc_doc_primitive = "isize" ]
12481226//
12491227/// The pointer-sized signed integer type.
12501228///
@@ -1254,8 +1232,7 @@ mod prim_u128 {}
12541232#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12551233mod prim_isize { }
12561234
1257- #[ cfg_attr( bootstrap, doc( primitive = "usize" ) ) ]
1258- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "usize" ) ]
1235+ #[ rustc_doc_primitive = "usize" ]
12591236//
12601237/// The pointer-sized unsigned integer type.
12611238///
@@ -1265,8 +1242,7 @@ mod prim_isize {}
12651242#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12661243mod prim_usize { }
12671244
1268- #[ cfg_attr( bootstrap, doc( primitive = "reference" ) ) ]
1269- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "reference" ) ]
1245+ #[ rustc_doc_primitive = "reference" ]
12701246#[ doc( alias = "&" ) ]
12711247#[ doc( alias = "&mut" ) ]
12721248//
@@ -1397,8 +1373,7 @@ mod prim_usize {}
13971373#[ stable( feature = "rust1" , since = "1.0.0" ) ]
13981374mod prim_ref { }
13991375
1400- #[ cfg_attr( bootstrap, doc( primitive = "fn" ) ) ]
1401- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "fn" ) ]
1376+ #[ rustc_doc_primitive = "fn" ]
14021377//
14031378/// Function pointers, like `fn(usize) -> bool`.
14041379///
0 commit comments