Skip to content

Commit

Permalink
Remove unused attrs field from keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Nov 26, 2020
1 parent e3e8087 commit 51f00b0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/librustdoc/clean/mod.rs
Expand Up @@ -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
};
Expand All @@ -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,
Expand Down
11 changes: 8 additions & 3 deletions src/librustdoc/clean/types.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
23 changes: 6 additions & 17 deletions 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;

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 51f00b0

Please sign in to comment.