diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2021-04-22 21:27:19 -0400 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2021-04-23 15:56:14 -0400 |
| commit | f3ef4b2cefb5f4dc944ed4ae2f74d9f9918d7822 (patch) | |
| tree | 366374e67e5a4e228332fe6325f0a3dfeb0473a6 /src/librustdoc/html/render | |
| parent | 1481af9f598c84d58fc1f720777a3e482d8a33c1 (diff) | |
| download | rust-f3ef4b2cefb5f4dc944ed4ae2f74d9f9918d7822.tar.gz rust-f3ef4b2cefb5f4dc944ed4ae2f74d9f9918d7822.zip | |
Use ItemType in cache
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 d773f37ad90..f1d0ba9319a 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) } } |
