mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
Add f16
and f128
to rustdoc's PrimitiveType
Fix a few places where these primitives were missing from librustdoc.
This commit is contained in:
parent
aa1c45908d
commit
ebc86e6f58
@ -1797,8 +1797,10 @@ impl PrimitiveType {
|
||||
sym::bool => Some(PrimitiveType::Bool),
|
||||
sym::char => Some(PrimitiveType::Char),
|
||||
sym::str => Some(PrimitiveType::Str),
|
||||
sym::f16 => Some(PrimitiveType::F16),
|
||||
sym::f32 => Some(PrimitiveType::F32),
|
||||
sym::f64 => Some(PrimitiveType::F64),
|
||||
sym::f128 => Some(PrimitiveType::F128),
|
||||
sym::array => Some(PrimitiveType::Array),
|
||||
sym::slice => Some(PrimitiveType::Slice),
|
||||
sym::tuple => Some(PrimitiveType::Tuple),
|
||||
@ -1831,8 +1833,10 @@ impl PrimitiveType {
|
||||
U32 => single(SimplifiedType::Uint(UintTy::U32)),
|
||||
U64 => single(SimplifiedType::Uint(UintTy::U64)),
|
||||
U128 => single(SimplifiedType::Uint(UintTy::U128)),
|
||||
F16 => single(SimplifiedType::Float(FloatTy::F16)),
|
||||
F32 => single(SimplifiedType::Float(FloatTy::F32)),
|
||||
F64 => single(SimplifiedType::Float(FloatTy::F64)),
|
||||
F128 => single(SimplifiedType::Float(FloatTy::F128)),
|
||||
Str => single(SimplifiedType::Str),
|
||||
Bool => single(SimplifiedType::Bool),
|
||||
Char => single(SimplifiedType::Char),
|
||||
|
@ -536,8 +536,10 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
|
||||
I64 => tcx.types.i64,
|
||||
I128 => tcx.types.i128,
|
||||
Isize => tcx.types.isize,
|
||||
F16 => tcx.types.f16,
|
||||
F32 => tcx.types.f32,
|
||||
F64 => tcx.types.f64,
|
||||
F128 => tcx.types.f128,
|
||||
U8 => tcx.types.u8,
|
||||
U16 => tcx.types.u16,
|
||||
U32 => tcx.types.u32,
|
||||
@ -2196,8 +2198,10 @@ fn resolve_primitive(path_str: &str, ns: Namespace) -> Option<Res> {
|
||||
"u32" => U32,
|
||||
"u64" => U64,
|
||||
"u128" => U128,
|
||||
"f16" => F16,
|
||||
"f32" => F32,
|
||||
"f64" => F64,
|
||||
"f128" => F128,
|
||||
"char" => Char,
|
||||
"bool" | "true" | "false" => Bool,
|
||||
"str" | "&str" => Str,
|
||||
|
@ -1,6 +1,8 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
#![feature(rustc_attrs)]
|
||||
#![feature(f16)]
|
||||
#![feature(f128)]
|
||||
|
||||
// @has foo/index.html '//h2[@id="primitives"]' 'Primitive Types'
|
||||
// @has foo/index.html '//a[@href="primitive.i32.html"]' 'i32'
|
||||
@ -13,9 +15,19 @@
|
||||
// @!has foo/index.html '//span' '🔒'
|
||||
#[rustc_doc_primitive = "i32"]
|
||||
/// this is a test!
|
||||
mod i32{}
|
||||
mod i32 {}
|
||||
|
||||
// @has foo/primitive.bool.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'hello'
|
||||
#[rustc_doc_primitive = "bool"]
|
||||
/// hello
|
||||
mod bool {}
|
||||
|
||||
// @has foo/primitive.f16.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'hello'
|
||||
#[rustc_doc_primitive = "f16"]
|
||||
/// hello
|
||||
mod f16 {}
|
||||
|
||||
// @has foo/primitive.f128.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'hello'
|
||||
#[rustc_doc_primitive = "f128"]
|
||||
/// hello
|
||||
mod f128 {}
|
||||
|
Loading…
Reference in New Issue
Block a user