Implement non-mod.rs mod statements
This commit is contained in:
parent
b39c4bc123
commit
07f51fb868
56 changed files with 605 additions and 62 deletions
|
@ -47,6 +47,9 @@ pub struct ParseSess {
|
|||
pub unstable_features: UnstableFeatures,
|
||||
pub config: CrateConfig,
|
||||
pub missing_fragment_specifiers: RefCell<HashSet<Span>>,
|
||||
// Spans where a `mod foo;` statement was included in a non-mod.rs file.
|
||||
// These are used to issue errors if the non_modrs_mods feature is not enabled.
|
||||
pub non_modrs_mods: RefCell<Vec<(ast::Ident, Span)>>,
|
||||
/// Used to determine and report recursive mod inclusions
|
||||
included_mod_stack: RefCell<Vec<PathBuf>>,
|
||||
code_map: Rc<CodeMap>,
|
||||
|
@ -70,6 +73,7 @@ impl ParseSess {
|
|||
missing_fragment_specifiers: RefCell::new(HashSet::new()),
|
||||
included_mod_stack: RefCell::new(vec![]),
|
||||
code_map,
|
||||
non_modrs_mods: RefCell::new(vec![]),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +90,10 @@ pub struct Directory {
|
|||
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum DirectoryOwnership {
|
||||
Owned,
|
||||
Owned {
|
||||
// None if `mod.rs`, `Some("foo")` if we're in `foo.rs`
|
||||
relative: Option<ast::Ident>,
|
||||
},
|
||||
UnownedViaBlock,
|
||||
UnownedViaMod(bool /* legacy warnings? */),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue