about summary refs log tree commit diff
path: root/src/librustc_parse/parser/module.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_parse/parser/module.rs')
-rw-r--r--src/librustc_parse/parser/module.rs21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/librustc_parse/parser/module.rs b/src/librustc_parse/parser/module.rs
index 2c752bd9f0a..e45a26bd441 100644
--- a/src/librustc_parse/parser/module.rs
+++ b/src/librustc_parse/parser/module.rs
@@ -1,8 +1,7 @@
-use crate::{new_sub_parser_from_file, Directory, DirectoryOwnership};
+use crate::new_sub_parser_from_file;
 
 use rustc_ast::ast::{self, Attribute, Ident, Mod};
-use rustc_ast::attr;
-use rustc_ast::token;
+use rustc_ast::{attr, token};
 use rustc_errors::{struct_span_err, PResult};
 use rustc_session::parse::ParseSess;
 use rustc_span::source_map::{FileName, Span};
@@ -10,6 +9,22 @@ use rustc_span::symbol::sym;
 
 use std::path::{self, Path, PathBuf};
 
+#[derive(Clone)]
+pub struct Directory {
+    pub path: PathBuf,
+    pub ownership: DirectoryOwnership,
+}
+
+#[derive(Copy, Clone)]
+pub enum DirectoryOwnership {
+    Owned {
+        // None if `mod.rs`, `Some("foo")` if we're in `foo.rs`.
+        relative: Option<ast::Ident>,
+    },
+    UnownedViaBlock,
+    UnownedViaMod,
+}
+
 /// Information about the path to a module.
 // Public for rustfmt usage.
 pub struct ModulePath<'a> {