Skip to content

Commit cc049f6

Browse files
committed
Add f16 and f128 to rustdoc's PrimitiveType
Fix a few places where these primitives were missing from librustdoc.
1 parent aa1c459 commit cc049f6

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/librustdoc/clean/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,8 +1797,10 @@ impl PrimitiveType {
17971797
sym::bool => Some(PrimitiveType::Bool),
17981798
sym::char => Some(PrimitiveType::Char),
17991799
sym::str => Some(PrimitiveType::Str),
1800+
sym::f16 => Some(PrimitiveType::F16),
18001801
sym::f32 => Some(PrimitiveType::F32),
18011802
sym::f64 => Some(PrimitiveType::F64),
1803+
sym::f128 => Some(PrimitiveType::F128),
18021804
sym::array => Some(PrimitiveType::Array),
18031805
sym::slice => Some(PrimitiveType::Slice),
18041806
sym::tuple => Some(PrimitiveType::Tuple),
@@ -1831,8 +1833,10 @@ impl PrimitiveType {
18311833
U32 => single(SimplifiedType::Uint(UintTy::U32)),
18321834
U64 => single(SimplifiedType::Uint(UintTy::U64)),
18331835
U128 => single(SimplifiedType::Uint(UintTy::U128)),
1836+
F16 => single(SimplifiedType::Float(FloatTy::F16)),
18341837
F32 => single(SimplifiedType::Float(FloatTy::F32)),
18351838
F64 => single(SimplifiedType::Float(FloatTy::F64)),
1839+
F128 => single(SimplifiedType::Float(FloatTy::F128)),
18361840
Str => single(SimplifiedType::Str),
18371841
Bool => single(SimplifiedType::Bool),
18381842
Char => single(SimplifiedType::Char),

src/librustdoc/passes/collect_intra_doc_links.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,10 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
536536
I64 => tcx.types.i64,
537537
I128 => tcx.types.i128,
538538
Isize => tcx.types.isize,
539+
F16 => tcx.types.f16,
539540
F32 => tcx.types.f32,
540541
F64 => tcx.types.f64,
542+
F128 => tcx.types.f128,
541543
U8 => tcx.types.u8,
542544
U16 => tcx.types.u16,
543545
U32 => tcx.types.u32,
@@ -2196,8 +2198,10 @@ fn resolve_primitive(path_str: &str, ns: Namespace) -> Option<Res> {
21962198
"u32" => U32,
21972199
"u64" => U64,
21982200
"u128" => U128,
2201+
"f16" => F16,
21992202
"f32" => F32,
22002203
"f64" => F64,
2204+
"f128" => F128,
22012205
"char" => Char,
22022206
"bool" | "true" | "false" => Bool,
22032207
"str" | "&str" => Str,

0 commit comments

Comments
 (0)