Fix compile error in rustdoc.

This commit is contained in:
Frank King 2024-01-18 14:35:14 +08:00
parent 7660d6bf2c
commit 822d6dc5fd

View File

@ -1892,15 +1892,8 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
TyKind::BareFn(barefn) => BareFunction(Box::new(clean_bare_fn_ty(barefn, cx))),
// Rustdoc handles `TyKind::Err`s by turning them into `Type::Infer`s.
TyKind::Infer | TyKind::Err(_) | TyKind::Typeof(..) | TyKind::InferDelegation(..) => Infer,
TyKind::AnonAdt(item_id) => {
let path = external_path(
cx,
item_id.owner_id.def_id.to_def_id(),
false,
ThinVec::new(),
ty::Binder::dummy(ty::GenericArgs::empty()),
);
Type::Path { path }
TyKind::AnonAdt(..) => {
unimplemented!("Anonymous structs or unions are not supported yet")
}
}
}