diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2021-04-25 01:53:15 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-25 01:53:15 +0900 |
| commit | e25c5e2c25d8bc7f192d7eb5b1bf5882cad4f4ba (patch) | |
| tree | a66be23157bf4d8f95b073a306e1087a6012e8ff /src/librustdoc/html/render | |
| parent | b566d0ae12aa53bfddfeafa61eaca3057a2c8ab2 (diff) | |
| parent | ab54197a46db20c61a4f08cf0f87b64572f78447 (diff) | |
| download | rust-e25c5e2c25d8bc7f192d7eb5b1bf5882cad4f4ba.tar.gz rust-e25c5e2c25d8bc7f192d7eb5b1bf5882cad4f4ba.zip | |
Rollup merge of #84464 - jyn514:type-kind, r=CraftSpider
rustdoc: Get rid of `clean::TypeKind` It does exactly the same thing as ItemType.
Diffstat (limited to 'src/librustdoc/html/render')
| -rw-r--r-- | src/librustdoc/html/render/cache.rs | 10 | ||||
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/librustdoc/html/render/cache.rs b/src/librustdoc/html/render/cache.rs index b8544a0f439..f93a0d4fc2d 100644 --- a/src/librustdoc/html/render/cache.rs +++ b/src/librustdoc/html/render/cache.rs @@ -7,7 +7,7 @@ use rustc_span::symbol::{sym, Symbol}; use serde::ser::{Serialize, SerializeStruct, Serializer}; use crate::clean::types::{ - FnDecl, FnRetTy, GenericBound, Generics, GetDefId, Type, TypeKind, WherePredicate, + FnDecl, FnRetTy, GenericBound, Generics, GetDefId, Type, WherePredicate, }; use crate::clean::{self, AttributesExt}; use crate::formats::cache::Cache; @@ -316,15 +316,15 @@ crate fn get_real_types<'tcx>( arg: &Type, tcx: TyCtxt<'tcx>, recurse: i32, - res: &mut FxHashSet<(Type, TypeKind)>, + res: &mut FxHashSet<(Type, ItemType)>, ) -> usize { - fn insert(res: &mut FxHashSet<(Type, TypeKind)>, tcx: TyCtxt<'_>, ty: Type) -> usize { + fn insert(res: &mut FxHashSet<(Type, ItemType)>, tcx: TyCtxt<'_>, ty: Type) -> usize { if let Some(kind) = ty.def_id().map(|did| tcx.def_kind(did).into()) { res.insert((ty, kind)); 1 } else if ty.is_primitive() { // This is a primitive, let's store it as such. - res.insert((ty, TypeKind::Primitive)); + res.insert((ty, ItemType::Primitive)); 1 } else { 0 @@ -394,7 +394,7 @@ crate fn get_all_types<'tcx>( generics: &Generics, decl: &FnDecl, tcx: TyCtxt<'tcx>, -) -> (Vec<(Type, TypeKind)>, Vec<(Type, TypeKind)>) { +) -> (Vec<(Type, ItemType)>, Vec<(Type, ItemType)>) { let mut all_types = FxHashSet::default(); for arg in decl.inputs.values.iter() { if arg.type_.is_self_type() { diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index f6d6b34f8be..3bf496f9d94 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -54,7 +54,7 @@ use rustc_span::symbol::{kw, sym, Symbol}; use serde::ser::SerializeSeq; use serde::{Serialize, Serializer}; -use crate::clean::{self, GetDefId, RenderedLink, SelfTy, TypeKind}; +use crate::clean::{self, GetDefId, RenderedLink, SelfTy}; use crate::docfs::PathError; use crate::error::Error; use crate::formats::cache::Cache; @@ -182,11 +182,11 @@ impl Serialize for IndexItemFunctionType { #[derive(Debug)] crate struct TypeWithKind { ty: RenderType, - kind: TypeKind, + kind: ItemType, } -impl From<(RenderType, TypeKind)> for TypeWithKind { - fn from(x: (RenderType, TypeKind)) -> TypeWithKind { +impl From<(RenderType, ItemType)> for TypeWithKind { + fn from(x: (RenderType, ItemType)) -> TypeWithKind { TypeWithKind { ty: x.0, kind: x.1 } } } @@ -196,7 +196,7 @@ impl Serialize for TypeWithKind { where S: Serializer, { - (&self.ty.name, ItemType::from(self.kind)).serialize(serializer) + (&self.ty.name, self.kind).serialize(serializer) } } |
