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" ) ]
@@ -581,8 +576,7 @@ impl Copy for () {
581576#[ stable( feature = "rust1" , since = "1.0.0" ) ]
582577mod prim_pointer { }
583578
584- #[ cfg_attr( bootstrap, doc( primitive = "array" ) ) ]
585- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "array" ) ]
579+ #[ rustc_doc_primitive = "array" ]
586580#[ doc( alias = "[]" ) ]
587581#[ doc( alias = "[T;N]" ) ] // unfortunately, rustdoc doesn't have fuzzy search for aliases
588582#[ doc( alias = "[T; N]" ) ]
@@ -783,8 +777,7 @@ mod prim_pointer {}
783777#[ stable( feature = "rust1" , since = "1.0.0" ) ]
784778mod prim_array { }
785779
786- #[ cfg_attr( bootstrap, doc( primitive = "slice" ) ) ]
787- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "slice" ) ]
780+ #[ rustc_doc_primitive = "slice" ]
788781#[ doc( alias = "[" ) ]
789782#[ doc( alias = "]" ) ]
790783#[ doc( alias = "[]" ) ]
@@ -876,8 +869,7 @@ mod prim_array {}
876869#[ stable( feature = "rust1" , since = "1.0.0" ) ]
877870mod prim_slice { }
878871
879- #[ cfg_attr( bootstrap, doc( primitive = "str" ) ) ]
880- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "str" ) ]
872+ #[ rustc_doc_primitive = "str" ]
881873/// String slices.
882874///
883875/// *[See also the `std::str` module](crate::str).*
@@ -944,8 +936,7 @@ mod prim_slice {}
944936#[ stable( feature = "rust1" , since = "1.0.0" ) ]
945937mod prim_str { }
946938
947- #[ cfg_attr( bootstrap, doc( primitive = "tuple" ) ) ]
948- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "tuple" ) ]
939+ #[ rustc_doc_primitive = "tuple" ]
949940#[ doc( alias = "(" ) ]
950941#[ doc( alias = ")" ) ]
951942#[ doc( alias = "()" ) ]
@@ -1088,8 +1079,7 @@ impl<T: Copy> Copy for (T,) {
10881079 // empty
10891080}
10901081
1091- #[ cfg_attr( bootstrap, doc( primitive = "f32" ) ) ]
1092- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "f32" ) ]
1082+ #[ rustc_doc_primitive = "f32" ]
10931083/// A 32-bit floating point type (specifically, the "binary32" type defined in IEEE 754-2008).
10941084///
10951085/// This type can represent a wide range of decimal numbers, like `3.5`, `27`,
@@ -1155,8 +1145,7 @@ impl<T: Copy> Copy for (T,) {
11551145#[ stable( feature = "rust1" , since = "1.0.0" ) ]
11561146mod prim_f32 { }
11571147
1158- #[ cfg_attr( bootstrap, doc( primitive = "f64" ) ) ]
1159- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "f64" ) ]
1148+ #[ rustc_doc_primitive = "f64" ]
11601149/// A 64-bit floating point type (specifically, the "binary64" type defined in IEEE 754-2008).
11611150///
11621151/// This type is very similar to [`f32`], but has increased
@@ -1171,78 +1160,67 @@ mod prim_f32 {}
11711160#[ stable( feature = "rust1" , since = "1.0.0" ) ]
11721161mod prim_f64 { }
11731162
1174- #[ cfg_attr( bootstrap, doc( primitive = "i8" ) ) ]
1175- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i8" ) ]
1163+ #[ rustc_doc_primitive = "i8" ]
11761164//
11771165/// The 8-bit signed integer type.
11781166#[ stable( feature = "rust1" , since = "1.0.0" ) ]
11791167mod prim_i8 { }
11801168
1181- #[ cfg_attr( bootstrap, doc( primitive = "i16" ) ) ]
1182- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i16" ) ]
1169+ #[ rustc_doc_primitive = "i16" ]
11831170//
11841171/// The 16-bit signed integer type.
11851172#[ stable( feature = "rust1" , since = "1.0.0" ) ]
11861173mod prim_i16 { }
11871174
1188- #[ cfg_attr( bootstrap, doc( primitive = "i32" ) ) ]
1189- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i32" ) ]
1175+ #[ rustc_doc_primitive = "i32" ]
11901176//
11911177/// The 32-bit signed integer type.
11921178#[ stable( feature = "rust1" , since = "1.0.0" ) ]
11931179mod prim_i32 { }
11941180
1195- #[ cfg_attr( bootstrap, doc( primitive = "i64" ) ) ]
1196- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i64" ) ]
1181+ #[ rustc_doc_primitive = "i64" ]
11971182//
11981183/// The 64-bit signed integer type.
11991184#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12001185mod prim_i64 { }
12011186
1202- #[ cfg_attr( bootstrap, doc( primitive = "i128" ) ) ]
1203- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "i128" ) ]
1187+ #[ rustc_doc_primitive = "i128" ]
12041188//
12051189/// The 128-bit signed integer type.
12061190#[ stable( feature = "i128" , since = "1.26.0" ) ]
12071191mod prim_i128 { }
12081192
1209- #[ cfg_attr( bootstrap, doc( primitive = "u8" ) ) ]
1210- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u8" ) ]
1193+ #[ rustc_doc_primitive = "u8" ]
12111194//
12121195/// The 8-bit unsigned integer type.
12131196#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12141197mod prim_u8 { }
12151198
1216- #[ cfg_attr( bootstrap, doc( primitive = "u16" ) ) ]
1217- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u16" ) ]
1199+ #[ rustc_doc_primitive = "u16" ]
12181200//
12191201/// The 16-bit unsigned integer type.
12201202#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12211203mod prim_u16 { }
12221204
1223- #[ cfg_attr( bootstrap, doc( primitive = "u32" ) ) ]
1224- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u32" ) ]
1205+ #[ rustc_doc_primitive = "u32" ]
12251206//
12261207/// The 32-bit unsigned integer type.
12271208#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12281209mod prim_u32 { }
12291210
1230- #[ cfg_attr( bootstrap, doc( primitive = "u64" ) ) ]
1231- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u64" ) ]
1211+ #[ rustc_doc_primitive = "u64" ]
12321212//
12331213/// The 64-bit unsigned integer type.
12341214#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12351215mod prim_u64 { }
12361216
1237- #[ cfg_attr( bootstrap, doc( primitive = "u128" ) ) ]
1238- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "u128" ) ]
1217+ #[ rustc_doc_primitive = "u128" ]
12391218//
12401219/// The 128-bit unsigned integer type.
12411220#[ stable( feature = "i128" , since = "1.26.0" ) ]
12421221mod prim_u128 { }
12431222
1244- #[ cfg_attr( bootstrap, doc( primitive = "isize" ) ) ]
1245- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "isize" ) ]
1223+ #[ rustc_doc_primitive = "isize" ]
12461224//
12471225/// The pointer-sized signed integer type.
12481226///
@@ -1252,8 +1230,7 @@ mod prim_u128 {}
12521230#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12531231mod prim_isize { }
12541232
1255- #[ cfg_attr( bootstrap, doc( primitive = "usize" ) ) ]
1256- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "usize" ) ]
1233+ #[ rustc_doc_primitive = "usize" ]
12571234//
12581235/// The pointer-sized unsigned integer type.
12591236///
@@ -1263,8 +1240,7 @@ mod prim_isize {}
12631240#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12641241mod prim_usize { }
12651242
1266- #[ cfg_attr( bootstrap, doc( primitive = "reference" ) ) ]
1267- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "reference" ) ]
1243+ #[ rustc_doc_primitive = "reference" ]
12681244#[ doc( alias = "&" ) ]
12691245#[ doc( alias = "&mut" ) ]
12701246//
@@ -1396,8 +1372,7 @@ mod prim_usize {}
13961372#[ stable( feature = "rust1" , since = "1.0.0" ) ]
13971373mod prim_ref { }
13981374
1399- #[ cfg_attr( bootstrap, doc( primitive = "fn" ) ) ]
1400- #[ cfg_attr( not( bootstrap) , rustc_doc_primitive = "fn" ) ]
1375+ #[ rustc_doc_primitive = "fn" ]
14011376//
14021377/// Function pointers, like `fn(usize) -> bool`.
14031378///
0 commit comments