]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/doctree.rs
Merge commit '5988bbd24aa87732bfa1d111ba00bcdaa22c481a' into sync_cg_clif-2020-11-27
[rust.git] / src / librustdoc / doctree.rs
index 1ceaed45ea9cf370fcd8035fa437b377da0e4091..20f747e2014158b3712c0501e078055c9db93d0e 100644 (file)
@@ -3,29 +3,22 @@
 crate use self::StructType::*;
 
 use rustc_ast as ast;
-use rustc_span::hygiene::MacroKind;
 use rustc_span::{self, symbol::Ident, Span, Symbol};
 
 use rustc_hir as hir;
-use rustc_hir::def_id::CrateNum;
-use rustc_hir::HirId;
 
 crate struct Module<'hir> {
     crate name: Option<Symbol>,
     crate attrs: &'hir [ast::Attribute],
     crate where_outer: Span,
     crate where_inner: Span,
-    crate extern_crates: Vec<ExternCrate<'hir>>,
     crate imports: Vec<Import<'hir>>,
-    crate fns: Vec<Function<'hir>>,
     crate mods: Vec<Module<'hir>>,
     crate id: hir::HirId,
     // (item, renamed)
     crate items: Vec<(&'hir hir::Item<'hir>, Option<Ident>)>,
-    crate traits: Vec<Trait<'hir>>,
     crate foreigns: Vec<(&'hir hir::ForeignItem<'hir>, Option<Ident>)>,
     crate macros: Vec<Macro>,
-    crate proc_macros: Vec<ProcMacro>,
     crate is_crate: bool,
 }
 
@@ -37,15 +30,11 @@ impl Module<'hir> {
             where_outer: rustc_span::DUMMY_SP,
             where_inner: rustc_span::DUMMY_SP,
             attrs,
-            extern_crates: Vec::new(),
             imports: Vec::new(),
-            fns: Vec::new(),
             mods: Vec::new(),
             items: Vec::new(),
-            traits: Vec::new(),
             foreigns: Vec::new(),
             macros: Vec::new(),
-            proc_macros: Vec::new(),
             is_crate: false,
         }
     }
@@ -67,26 +56,6 @@ impl Module<'hir> {
     crate def: &'hir hir::VariantData<'hir>,
 }
 
-crate struct Function<'hir> {
-    crate decl: &'hir hir::FnDecl<'hir>,
-    crate id: hir::HirId,
-    crate name: Symbol,
-    crate header: hir::FnHeader,
-    crate generics: &'hir hir::Generics<'hir>,
-    crate body: hir::BodyId,
-}
-
-crate struct Trait<'hir> {
-    crate is_auto: hir::IsAuto,
-    crate unsafety: hir::Unsafety,
-    crate name: Symbol,
-    crate items: Vec<&'hir hir::TraitItem<'hir>>,
-    crate generics: &'hir hir::Generics<'hir>,
-    crate bounds: &'hir [hir::GenericBound<'hir>],
-    crate attrs: &'hir [ast::Attribute],
-    crate id: hir::HirId,
-}
-
 // For Macro we store the DefId instead of the NodeId, since we also create
 // these imported macro_rules (which only have a DUMMY_NODE_ID).
 crate struct Macro {
@@ -96,16 +65,6 @@ impl Module<'hir> {
     crate imported_from: Option<Symbol>,
 }
 
-crate struct ExternCrate<'hir> {
-    crate name: Symbol,
-    crate hir_id: HirId,
-    crate cnum: CrateNum,
-    crate path: Option<String>,
-    crate vis: &'hir hir::Visibility<'hir>,
-    crate attrs: &'hir [ast::Attribute],
-    crate span: Span,
-}
-
 #[derive(Debug)]
 crate struct Import<'hir> {
     crate name: Symbol,
@@ -117,13 +76,6 @@ impl Module<'hir> {
     crate span: Span,
 }
 
-crate struct ProcMacro {
-    crate name: Symbol,
-    crate id: hir::HirId,
-    crate kind: MacroKind,
-    crate helpers: Vec<Symbol>,
-}
-
 crate fn struct_type_from_def(vdata: &hir::VariantData<'_>) -> StructType {
     match *vdata {
         hir::VariantData::Struct(..) => Plain,