diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2020-11-23 22:40:36 -0500 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2020-11-26 14:23:42 -0500 |
| commit | 51f00b08ebbfb8b6866c855fdef8c663ed5c52bc (patch) | |
| tree | 0836c7f429d0b507e368af055ef297fdd80254ce /src | |
| parent | e3e808730922d0509f0ede7addbf257f28424cfd (diff) | |
| download | rust-51f00b08ebbfb8b6866c855fdef8c663ed5c52bc.tar.gz rust-51f00b08ebbfb8b6866c855fdef8c663ed5c52bc.zip | |
Remove unused `attrs` field from `keywords`
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 6 | ||||
| -rw-r--r-- | src/librustdoc/clean/types.rs | 11 | ||||
| -rw-r--r-- | src/librustdoc/clean/utils.rs | 23 |
3 files changed, 17 insertions, 23 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index d31ff554608..03fda94a6df 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -177,7 +177,7 @@ impl Clean<ExternalCrate> for CrateNum { } } } - return keyword.map(|p| (def_id, p, attrs)); + return keyword.map(|p| (def_id, p)); } None }; @@ -199,8 +199,8 @@ impl Clean<ExternalCrate> for CrateNum { hir::ItemKind::Use(ref path, hir::UseKind::Single) if item.vis.node.is_pub() => { - as_keyword(path.res).map(|(_, prim, attrs)| { - (cx.tcx.hir().local_def_id(id.id).to_def_id(), prim, attrs) + as_keyword(path.res).map(|(_, prim)| { + (cx.tcx.hir().local_def_id(id.id).to_def_id(), prim) }) } _ => None, diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 3d2cab70f91..2283b71a94f 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -33,8 +33,8 @@ use smallvec::{smallvec, SmallVec}; use crate::clean::cfg::Cfg; use crate::clean::external_path; use crate::clean::inline; -use crate::clean::Clean; use crate::clean::types::Type::{QPath, ResolvedPath}; +use crate::clean::Clean; use crate::core::DocContext; use crate::doctree; use crate::formats::cache::cache; @@ -69,7 +69,7 @@ crate struct ExternalCrate { crate src: FileName, crate attrs: Attributes, crate primitives: Vec<(DefId, PrimitiveType)>, - crate keywords: Vec<(DefId, String, Attributes)>, + crate keywords: Vec<(DefId, String)>, } /// Anything with a source location and set of attributes and, optionally, a @@ -121,7 +121,12 @@ impl Item { kind: ItemKind, cx: &DocContext<'_>, ) -> Item { - Item::from_def_id_and_parts(cx.tcx.hir().local_def_id(hir_id).to_def_id(), name.clean(cx), kind, cx) + Item::from_def_id_and_parts( + cx.tcx.hir().local_def_id(hir_id).to_def_id(), + name.clean(cx), + kind, + cx, + ) } pub fn from_def_id_and_parts( diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs index 986703149f1..1b22d26f49b 100644 --- a/src/librustdoc/clean/utils.rs +++ b/src/librustdoc/clean/utils.rs @@ -1,10 +1,10 @@ use crate::clean::auto_trait::AutoTraitFinder; use crate::clean::blanket_impl::BlanketImplFinder; use crate::clean::{ - inline, Clean, Crate, ExternalCrate, FnDecl, FnRetTy, Generic, GenericArg, - GenericArgs, GenericBound, Generics, GetDefId, ImportSource, Item, ItemKind, Lifetime, - MacroKind, Path, PathSegment, Primitive, PrimitiveType, ResolvedPath, Type, TypeBinding, - TypeKind, WherePredicate, + inline, Clean, Crate, ExternalCrate, FnDecl, FnRetTy, Generic, GenericArg, GenericArgs, + GenericBound, Generics, GetDefId, ImportSource, Item, ItemKind, Lifetime, MacroKind, Path, + PathSegment, Primitive, PrimitiveType, ResolvedPath, Type, TypeBinding, TypeKind, + WherePredicate, }; use crate::core::DocContext; @@ -73,20 +73,9 @@ crate fn krate(mut cx: &mut DocContext<'_>) -> Crate { cx, ) })); - m.items.extend(keywords.into_iter() - .map(|(def_id, kw, _)| Item::from_def_id_and_parts(def_id, Some(kw.clone()), ItemKind::KeywordItem(kw), cx) - )); - /* - source: Span::empty(), - name: Some(kw.clone()), - attrs, - visibility: Visibility::Public, - stability: get_stability(cx, def_id), - deprecation: get_deprecation(cx, def_id), - def_id, - kind: ItemKind::KeywordItem(kw), + m.items.extend(keywords.into_iter().map(|(def_id, kw)| { + Item::from_def_id_and_parts(def_id, Some(kw.clone()), ItemKind::KeywordItem(kw), cx) })); - */ } Crate { |
