From 85ec09187c5d75a49659a82882a97cc93baff5af Mon Sep 17 00:00:00 2001 From: est31 Date: Mon, 21 Nov 2016 05:40:35 +0100 Subject: [PATCH] Make rustdoc aware of the primitive i128 type Many thanks to ollie27 for spotting all the places. --- src/librustdoc/clean/inline.rs | 2 ++ src/librustdoc/clean/mod.rs | 2 ++ src/libstd/primitive_docs.rs | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index cba5e1ba6f3..93854193762 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -268,11 +268,13 @@ pub fn build_impls(cx: &DocContext, did: DefId) -> Vec { tcx.lang_items.i16_impl(), tcx.lang_items.i32_impl(), tcx.lang_items.i64_impl(), + tcx.lang_items.i128_impl(), tcx.lang_items.usize_impl(), tcx.lang_items.u8_impl(), tcx.lang_items.u16_impl(), tcx.lang_items.u32_impl(), tcx.lang_items.u64_impl(), + tcx.lang_items.u128_impl(), tcx.lang_items.f32_impl(), tcx.lang_items.f64_impl(), tcx.lang_items.char_impl(), diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 5978791fbc7..e0a26ca3181 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1595,11 +1595,13 @@ fn from_str(s: &str) -> Option { "i16" => Some(PrimitiveType::I16), "i32" => Some(PrimitiveType::I32), "i64" => Some(PrimitiveType::I64), + "i128" => Some(PrimitiveType::I128), "usize" => Some(PrimitiveType::Usize), "u8" => Some(PrimitiveType::U8), "u16" => Some(PrimitiveType::U16), "u32" => Some(PrimitiveType::U32), "u64" => Some(PrimitiveType::U64), + "u128" => Some(PrimitiveType::U128), "bool" => Some(PrimitiveType::Bool), "char" => Some(PrimitiveType::Char), "str" => Some(PrimitiveType::Str), diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs index 54dde6681e1..5981b482a97 100644 --- a/src/libstd/primitive_docs.rs +++ b/src/libstd/primitive_docs.rs @@ -597,6 +597,17 @@ mod prim_i32 { } /// mod prim_i64 { } +#[doc(primitive = "i128")] +// +/// The 128-bit signed integer type. +/// +/// *[See also the `std::i128` module](i128/index.html).* +/// +/// However, please note that examples are shared between primitive integer +/// types. So it's normal if you see usage of types like `i8` in there. +/// +mod prim_i128 { } + #[doc(primitive = "u8")] // /// The 8-bit unsigned integer type. @@ -641,6 +652,17 @@ mod prim_u32 { } /// mod prim_u64 { } +#[doc(primitive = "u128")] +// +/// The 128-bit unsigned integer type. +/// +/// *[See also the `std::u128` module](u128/index.html).* +/// +/// However, please note that examples are shared between primitive integer +/// types. So it's normal if you see usage of types like `u8` in there. +/// +mod prim_u128 { } + #[doc(primitive = "isize")] // /// The pointer-sized signed integer type. -- GitLab