]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/doctree.rs
Add more proc-macro attribute tests
[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: Option<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     crate is_crate: bool,
18 }
19
20 impl Module<'hir> {
21     crate fn new(name: Option<Symbol>) -> Module<'hir> {
22         Module {
23             name,
24             id: hir::CRATE_HIR_ID,
25             where_outer: rustc_span::DUMMY_SP,
26             where_inner: rustc_span::DUMMY_SP,
27             mods: Vec::new(),
28             items: Vec::new(),
29             foreigns: Vec::new(),
30             macros: Vec::new(),
31             is_crate: false,
32         }
33     }
34 }