]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/doctree.rs
Auto merge of #84725 - sebpop:arm64-isb, r=joshtriplett
[rust.git] / src / librustdoc / doctree.rs
1 //! This module is used to store stuff from Rust's AST in a more convenient
2 //! manner (and with prettier names) before cleaning.
3 use rustc_span::{self, Span, Symbol};
4
5 use rustc_hir as hir;
6
7 crate struct Module<'hir> {
8     crate name: Symbol,
9     crate where_outer: Span,
10     crate where_inner: Span,
11     crate mods: Vec<Module<'hir>>,
12     crate id: hir::HirId,
13     // (item, renamed)
14     crate items: Vec<(&'hir hir::Item<'hir>, Option<Symbol>)>,
15     crate foreigns: Vec<(&'hir hir::ForeignItem<'hir>, Option<Symbol>)>,
16     crate macros: Vec<(&'hir hir::MacroDef<'hir>, Option<Symbol>)>,
17 }
18
19 impl Module<'hir> {
20     crate fn new(name: Symbol) -> Module<'hir> {
21         Module {
22             name,
23             id: hir::CRATE_HIR_ID,
24             where_outer: rustc_span::DUMMY_SP,
25             where_inner: rustc_span::DUMMY_SP,
26             mods: Vec::new(),
27             items: Vec::new(),
28             foreigns: Vec::new(),
29             macros: Vec::new(),
30         }
31     }
32 }