Skip to content

Commit 51f00b0

Browse files
committed
Remove unused attrs field from keywords
1 parent e3e8087 commit 51f00b0

File tree

3 files changed

+17
-23
lines changed

3 files changed

+17
-23
lines changed

src/librustdoc/clean/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl Clean<ExternalCrate> for CrateNum {
177177
}
178178
}
179179
}
180-
return keyword.map(|p| (def_id, p, attrs));
180+
return keyword.map(|p| (def_id, p));
181181
}
182182
None
183183
};
@@ -199,8 +199,8 @@ impl Clean<ExternalCrate> for CrateNum {
199199
hir::ItemKind::Use(ref path, hir::UseKind::Single)
200200
if item.vis.node.is_pub() =>
201201
{
202-
as_keyword(path.res).map(|(_, prim, attrs)| {
203-
(cx.tcx.hir().local_def_id(id.id).to_def_id(), prim, attrs)
202+
as_keyword(path.res).map(|(_, prim)| {
203+
(cx.tcx.hir().local_def_id(id.id).to_def_id(), prim)
204204
})
205205
}
206206
_ => None,

src/librustdoc/clean/types.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ use smallvec::{smallvec, SmallVec};
3333
use crate::clean::cfg::Cfg;
3434
use crate::clean::external_path;
3535
use crate::clean::inline;
36-
use crate::clean::Clean;
3736
use crate::clean::types::Type::{QPath, ResolvedPath};
37+
use crate::clean::Clean;
3838
use crate::core::DocContext;
3939
use crate::doctree;
4040
use crate::formats::cache::cache;
@@ -69,7 +69,7 @@ crate struct ExternalCrate {
6969
crate src: FileName,
7070
crate attrs: Attributes,
7171
crate primitives: Vec<(DefId, PrimitiveType)>,
72-
crate keywords: Vec<(DefId, String, Attributes)>,
72+
crate keywords: Vec<(DefId, String)>,
7373
}
7474

7575
/// Anything with a source location and set of attributes and, optionally, a
@@ -121,7 +121,12 @@ impl Item {
121121
kind: ItemKind,
122122
cx: &DocContext<'_>,
123123
) -> Item {
124-
Item::from_def_id_and_parts(cx.tcx.hir().local_def_id(hir_id).to_def_id(), name.clean(cx), kind, cx)
124+
Item::from_def_id_and_parts(
125+
cx.tcx.hir().local_def_id(hir_id).to_def_id(),
126+
name.clean(cx),
127+
kind,
128+
cx,
129+
)
125130
}
126131

127132
pub fn from_def_id_and_parts(

src/librustdoc/clean/utils.rs

+6-17
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use crate::clean::auto_trait::AutoTraitFinder;
22
use crate::clean::blanket_impl::BlanketImplFinder;
33
use crate::clean::{
4-
inline, Clean, Crate, ExternalCrate, FnDecl, FnRetTy, Generic, GenericArg,
5-
GenericArgs, GenericBound, Generics, GetDefId, ImportSource, Item, ItemKind, Lifetime,
6-
MacroKind, Path, PathSegment, Primitive, PrimitiveType, ResolvedPath, Type, TypeBinding,
7-
TypeKind, WherePredicate,
4+
inline, Clean, Crate, ExternalCrate, FnDecl, FnRetTy, Generic, GenericArg, GenericArgs,
5+
GenericBound, Generics, GetDefId, ImportSource, Item, ItemKind, Lifetime, MacroKind, Path,
6+
PathSegment, Primitive, PrimitiveType, ResolvedPath, Type, TypeBinding, TypeKind,
7+
WherePredicate,
88
};
99
use crate::core::DocContext;
1010

@@ -73,20 +73,9 @@ crate fn krate(mut cx: &mut DocContext<'_>) -> Crate {
7373
cx,
7474
)
7575
}));
76-
m.items.extend(keywords.into_iter()
77-
.map(|(def_id, kw, _)| Item::from_def_id_and_parts(def_id, Some(kw.clone()), ItemKind::KeywordItem(kw), cx)
78-
));
79-
/*
80-
source: Span::empty(),
81-
name: Some(kw.clone()),
82-
attrs,
83-
visibility: Visibility::Public,
84-
stability: get_stability(cx, def_id),
85-
deprecation: get_deprecation(cx, def_id),
86-
def_id,
87-
kind: ItemKind::KeywordItem(kw),
76+
m.items.extend(keywords.into_iter().map(|(def_id, kw)| {
77+
Item::from_def_id_and_parts(def_id, Some(kw.clone()), ItemKind::KeywordItem(kw), cx)
8878
}));
89-
*/
9079
}
9180

9281
Crate {

0 commit comments

Comments
 (0)