diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-08-12 07:32:38 -0400 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-08-26 18:52:27 -0400 |
| commit | 95f5698c10dbf92e444abc5334a3b1333b20cb0f (patch) | |
| tree | 153403e3629554a6816f0417ee553a34c742ffca /src | |
| parent | 57d57c67843f05a40d11c7d442bd5b461da6ddee (diff) | |
| download | rust-95f5698c10dbf92e444abc5334a3b1333b20cb0f.tar.gz rust-95f5698c10dbf92e444abc5334a3b1333b20cb0f.zip | |
Remove dead tracking of external param names
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 19 | ||||
| -rw-r--r-- | src/librustdoc/html/render.rs | 26 |
2 files changed, 0 insertions, 45 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 62900fa9fb1..ed82c522779 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -566,23 +566,6 @@ pub enum ItemEnum { } impl ItemEnum { - pub fn generics(&self) -> Option<&Generics> { - Some(match *self { - ItemEnum::StructItem(ref s) => &s.generics, - ItemEnum::EnumItem(ref e) => &e.generics, - ItemEnum::FunctionItem(ref f) => &f.generics, - ItemEnum::TypedefItem(ref t, _) => &t.generics, - ItemEnum::OpaqueTyItem(ref t, _) => &t.generics, - ItemEnum::TraitItem(ref t) => &t.generics, - ItemEnum::ImplItem(ref i) => &i.generics, - ItemEnum::TyMethodItem(ref i) => &i.generics, - ItemEnum::MethodItem(ref i) => &i.generics, - ItemEnum::ForeignFunctionItem(ref f) => &f.generics, - ItemEnum::TraitAliasItem(ref ta) => &ta.generics, - _ => return None, - }) - } - pub fn is_associated(&self) -> bool { match *self { ItemEnum::TypedefItem(_, _) | @@ -1535,8 +1518,6 @@ impl Clean<GenericParamDef> for ty::GenericParamDef { (self.name.to_string(), GenericParamDefKind::Lifetime) } ty::GenericParamDefKind::Type { has_default, synthetic, .. } => { - cx.renderinfo.borrow_mut().external_param_names - .insert(self.def_id, self.name.clean(cx)); let default = if has_default { Some(cx.tcx.type_of(self.def_id).clean(cx)) } else { diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index c8921a92d33..896246126d8 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -282,11 +282,6 @@ impl Impl { /// rendering threads. #[derive(Default)] pub struct Cache { - /// Mapping of typaram ids to the name of the type parameter. This is used - /// when pretty-printing a type (so pretty-printing doesn't have to - /// painfully maintain a context like this) - pub param_names: FxHashMap<DefId, String>, - /// Maps a type ID to all known implementations for that type. This is only /// recognized for intra-crate `ResolvedPath` types, and is used to print /// out extra documentation on the page of an enum/struct. @@ -382,7 +377,6 @@ pub struct Cache { pub struct RenderInfo { pub inlined: FxHashSet<DefId>, pub external_paths: crate::core::ExternalPaths, - pub external_param_names: FxHashMap<DefId, String>, pub exact_paths: FxHashMap<DefId, Vec<String>>, pub access_levels: AccessLevels<DefId>, pub deref_trait_did: Option<DefId>, @@ -617,7 +611,6 @@ pub fn run(mut krate: clean::Crate, let RenderInfo { inlined: _, external_paths, - external_param_names, exact_paths, access_levels, deref_trait_did, @@ -651,7 +644,6 @@ pub fn run(mut krate: clean::Crate, deref_mut_trait_did, owned_box_did, masked_crates: mem::take(&mut krate.masked_crates), - param_names: external_param_names, aliases: Default::default(), }; @@ -1419,12 +1411,6 @@ impl DocFolder for Cache { } } - // Register any generics to their corresponding string. This is used - // when pretty-printing types. - if let Some(generics) = item.inner.generics() { - self.generics(generics); - } - // Propagate a trait method's documentation to all implementors of the // trait. if let clean::TraitItem(ref t) = item.inner { @@ -1657,18 +1643,6 @@ impl DocFolder for Cache { } impl Cache { - fn generics(&mut self, generics: &clean::Generics) { - for param in &generics.params { - match param.kind { - clean::GenericParamDefKind::Lifetime => {} - clean::GenericParamDefKind::Type { did, .. } | - clean::GenericParamDefKind::Const { did, .. } => { - self.param_names.insert(did, param.name.clone()); - } - } - } - } - fn add_aliases(&mut self, item: &clean::Item) { if item.def_id.index == CRATE_DEF_INDEX { return |
