From 973cf632d37b55095d1ff47b62de43c1864c4115 Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Mon, 3 Jan 2022 18:08:19 +0000 Subject: [PATCH] Remove unsupported types in primitive_to_ty conversion, add FIXME note --- src/librustdoc/passes/collect_intra_doc_links.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index 680a74e5aa63..795300862820 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -625,6 +625,9 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> { use PrimitiveType::*; let tcx = self.cx.tcx; + // FIXME: Only simple types are supported here, see if we can support + // other types such as Tuple, Array, Slice, etc. + // See https://github.com/rust-lang/rust/issues/90703#issuecomment-1004263455 Some(tcx.mk_ty(match prim { Bool => ty::Bool, Str => ty::Str, @@ -644,14 +647,6 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> { U64 => ty::Uint(ty::UintTy::U64), U128 => ty::Uint(ty::UintTy::U128), Usize => ty::Uint(ty::UintTy::Usize), - //ty::Tuple(tys) if tys.is_empty() => Res::Primitive(Unit), - //ty::Tuple(_) => Res::Primitive(Tuple), - //ty::Array(..) => Res::Primitive(Array), - //ty::Slice(_) => Res::Primitive(Slice), - //ty::RawPtr(_) => Res::Primitive(RawPointer), - //ty::Ref(..) => Res::Primitive(Reference), - //ty::FnDef(..) => panic!("type alias to a function definition"), - //ty::FnPtr(_) => Res::Primitive(Fn), _ => return None, })) }