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_middle::ty::TyCtxt;
4 use rustc_span::{self, Span, Symbol};
8 crate struct Module<'hir> {
10 crate where_inner: Span,
11 crate mods: Vec<Module<'hir>>,
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>)>,
20 crate fn new(name: Symbol, id: hir::HirId, where_inner: Span) -> Module<'hir> {
32 crate fn where_outer(&self, tcx: TyCtxt<'_>) -> Span {
33 tcx.hir().span(self.id)