Skip to content

Commit

Permalink
Remove unsupported types in primitive_to_ty conversion, add FIXME note
Browse files Browse the repository at this point in the history
  • Loading branch information
mdibaiee committed Jan 3, 2022
1 parent 5512b8d commit eb00e14
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
}))
}
Expand Down

0 comments on commit eb00e14

Please sign in to comment.