]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_middle/src/metadata.rs
review comment: add test case
[rust.git] / compiler / rustc_middle / src / metadata.rs
1 use crate::ty;
2
3 use rustc_hir::def::Res;
4 use rustc_macros::HashStable;
5 use rustc_span::def_id::DefId;
6 use rustc_span::symbol::Ident;
7 use rustc_span::Span;
8
9 /// This structure is supposed to keep enough data to re-create `NameBinding`s for other crates
10 /// during name resolution. Right now the bindings are not recreated entirely precisely so we may
11 /// need to add more data in the future to correctly support macros 2.0, for example.
12 /// Module child can be either a proper item or a reexport (including private imports).
13 /// In case of reexport all the fields describe the reexport item itself, not what it refers to.
14 #[derive(Copy, Clone, Debug, TyEncodable, TyDecodable, HashStable)]
15 pub struct ModChild {
16     /// Name of the item.
17     pub ident: Ident,
18     /// Resolution result corresponding to the item.
19     /// Local variables cannot be exported, so this `Res` doesn't need the ID parameter.
20     pub res: Res<!>,
21     /// Visibility of the item.
22     pub vis: ty::Visibility<DefId>,
23     /// Span of the item.
24     pub span: Span,
25     /// A proper `macro_rules` item (not a reexport).
26     pub macro_rules: bool,
27 }