Skip to content

Commit 95f5698

Browse files
Remove dead tracking of external param names
1 parent 57d57c6 commit 95f5698

File tree

2 files changed

+0
-45
lines changed

2 files changed

+0
-45
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -566,23 +566,6 @@ pub enum ItemEnum {
566566
}
567567

568568
impl ItemEnum {
569-
pub fn generics(&self) -> Option<&Generics> {
570-
Some(match *self {
571-
ItemEnum::StructItem(ref s) => &s.generics,
572-
ItemEnum::EnumItem(ref e) => &e.generics,
573-
ItemEnum::FunctionItem(ref f) => &f.generics,
574-
ItemEnum::TypedefItem(ref t, _) => &t.generics,
575-
ItemEnum::OpaqueTyItem(ref t, _) => &t.generics,
576-
ItemEnum::TraitItem(ref t) => &t.generics,
577-
ItemEnum::ImplItem(ref i) => &i.generics,
578-
ItemEnum::TyMethodItem(ref i) => &i.generics,
579-
ItemEnum::MethodItem(ref i) => &i.generics,
580-
ItemEnum::ForeignFunctionItem(ref f) => &f.generics,
581-
ItemEnum::TraitAliasItem(ref ta) => &ta.generics,
582-
_ => return None,
583-
})
584-
}
585-
586569
pub fn is_associated(&self) -> bool {
587570
match *self {
588571
ItemEnum::TypedefItem(_, _) |
@@ -1535,8 +1518,6 @@ impl Clean<GenericParamDef> for ty::GenericParamDef {
15351518
(self.name.to_string(), GenericParamDefKind::Lifetime)
15361519
}
15371520
ty::GenericParamDefKind::Type { has_default, synthetic, .. } => {
1538-
cx.renderinfo.borrow_mut().external_param_names
1539-
.insert(self.def_id, self.name.clean(cx));
15401521
let default = if has_default {
15411522
Some(cx.tcx.type_of(self.def_id).clean(cx))
15421523
} else {

src/librustdoc/html/render.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,6 @@ impl Impl {
282282
/// rendering threads.
283283
#[derive(Default)]
284284
pub struct Cache {
285-
/// Mapping of typaram ids to the name of the type parameter. This is used
286-
/// when pretty-printing a type (so pretty-printing doesn't have to
287-
/// painfully maintain a context like this)
288-
pub param_names: FxHashMap<DefId, String>,
289-
290285
/// Maps a type ID to all known implementations for that type. This is only
291286
/// recognized for intra-crate `ResolvedPath` types, and is used to print
292287
/// out extra documentation on the page of an enum/struct.
@@ -382,7 +377,6 @@ pub struct Cache {
382377
pub struct RenderInfo {
383378
pub inlined: FxHashSet<DefId>,
384379
pub external_paths: crate::core::ExternalPaths,
385-
pub external_param_names: FxHashMap<DefId, String>,
386380
pub exact_paths: FxHashMap<DefId, Vec<String>>,
387381
pub access_levels: AccessLevels<DefId>,
388382
pub deref_trait_did: Option<DefId>,
@@ -617,7 +611,6 @@ pub fn run(mut krate: clean::Crate,
617611
let RenderInfo {
618612
inlined: _,
619613
external_paths,
620-
external_param_names,
621614
exact_paths,
622615
access_levels,
623616
deref_trait_did,
@@ -651,7 +644,6 @@ pub fn run(mut krate: clean::Crate,
651644
deref_mut_trait_did,
652645
owned_box_did,
653646
masked_crates: mem::take(&mut krate.masked_crates),
654-
param_names: external_param_names,
655647
aliases: Default::default(),
656648
};
657649

@@ -1419,12 +1411,6 @@ impl DocFolder for Cache {
14191411
}
14201412
}
14211413

1422-
// Register any generics to their corresponding string. This is used
1423-
// when pretty-printing types.
1424-
if let Some(generics) = item.inner.generics() {
1425-
self.generics(generics);
1426-
}
1427-
14281414
// Propagate a trait method's documentation to all implementors of the
14291415
// trait.
14301416
if let clean::TraitItem(ref t) = item.inner {
@@ -1657,18 +1643,6 @@ impl DocFolder for Cache {
16571643
}
16581644

16591645
impl Cache {
1660-
fn generics(&mut self, generics: &clean::Generics) {
1661-
for param in &generics.params {
1662-
match param.kind {
1663-
clean::GenericParamDefKind::Lifetime => {}
1664-
clean::GenericParamDefKind::Type { did, .. } |
1665-
clean::GenericParamDefKind::Const { did, .. } => {
1666-
self.param_names.insert(did, param.name.clone());
1667-
}
1668-
}
1669-
}
1670-
}
1671-
16721646
fn add_aliases(&mut self, item: &clean::Item) {
16731647
if item.def_id.index == CRATE_DEF_INDEX {
16741648
return

0 commit comments

Comments
 (0)