rust/src/librustdoc/doctree.rs

35 lines
1.0 KiB
Rust
Raw Normal View History

2013-08-15 22:28:54 +02:00
//! This module is used to store stuff from Rust's AST in a more convenient
//! manner (and with prettier names) before cleaning.
use rustc_span::{self, Span, Symbol};
use rustc_hir as hir;
2014-05-16 19:15:33 +02:00
crate struct Module<'hir> {
crate name: Option<Symbol>,
crate where_outer: Span,
crate where_inner: Span,
crate mods: Vec<Module<'hir>>,
crate id: hir::HirId,
2020-11-21 16:10:03 +01:00
// (item, renamed)
crate items: Vec<(&'hir hir::Item<'hir>, Option<Symbol>)>,
crate foreigns: Vec<(&'hir hir::ForeignItem<'hir>, Option<Symbol>)>,
crate macros: Vec<(&'hir hir::MacroDef<'hir>, Option<Symbol>)>,
crate is_crate: bool,
2013-08-15 22:28:54 +02:00
}
2019-06-12 10:43:15 +02:00
impl Module<'hir> {
crate fn new(name: Option<Symbol>) -> Module<'hir> {
2013-08-15 22:28:54 +02:00
Module {
name,
2019-07-24 22:28:51 +02:00
id: hir::CRATE_HIR_ID,
where_outer: rustc_span::DUMMY_SP,
where_inner: rustc_span::DUMMY_SP,
2019-12-22 23:42:04 +01:00
mods: Vec::new(),
items: Vec::new(),
2019-12-22 23:42:04 +01:00
foreigns: Vec::new(),
macros: Vec::new(),
is_crate: false,
2013-08-15 22:28:54 +02:00
}
}
}