about summary refs log tree commit diff
path: root/src/librustc_parse
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-03-21 22:51:03 +0100
committerMazdak Farrokhzad <twingoow@gmail.com>2020-03-21 22:51:03 +0100
commitd18ed205c9032003e2f3b3227a40bdc8f8763c9b (patch)
tree0749233960833178d47281f48e290d9fe223ae24 /src/librustc_parse
parent38114ff16e7856f98b2b4be7ab4cd29b38bed59a (diff)
parse: nix unused `root_module_name`.
Diffstat (limited to 'src/librustc_parse')
-rw-r--r--src/librustc_parse/lib.rs15
-rw-r--r--src/librustc_parse/parser/mod.rs5
2 files changed, 4 insertions, 16 deletions
diff --git a/src/librustc_parse/lib.rs b/src/librustc_parse/lib.rs
index 58db7d286e7..112c733a81b 100644
--- a/src/librustc_parse/lib.rs
+++ b/src/librustc_parse/lib.rs
@@ -120,18 +120,11 @@ pub fn maybe_new_parser_from_file<'a>(
     maybe_source_file_to_parser(sess, file)
 }
 
-/// Given a session, a crate config, a path, and a span, add
-/// the file at the given path to the `source_map`, and returns a parser.
+/// Given a session, a path, and a span,
+/// add the file at the given path to the `source_map`, and returns a parser.
 /// On an error, uses the given span as the source of the problem.
-pub fn new_sub_parser_from_file<'a>(
-    sess: &'a ParseSess,
-    path: &Path,
-    module_name: Option<String>,
-    sp: Span,
-) -> Parser<'a> {
-    let mut p = source_file_to_parser(sess, file_to_source_file(sess, path, Some(sp)));
-    p.root_module_name = module_name;
-    p
+pub fn new_sub_parser_from_file<'a>(sess: &'a ParseSess, path: &Path, sp: Span) -> Parser<'a> {
+    source_file_to_parser(sess, file_to_source_file(sess, path, Some(sp)))
 }
 
 /// Given a `source_file` and config, returns a parser.
diff --git a/src/librustc_parse/parser/mod.rs b/src/librustc_parse/parser/mod.rs
index bb6793d08aa..b987813e38d 100644
--- a/src/librustc_parse/parser/mod.rs
+++ b/src/librustc_parse/parser/mod.rs
@@ -88,10 +88,6 @@ pub struct Parser<'a> {
     /// The previous token.
     pub prev_token: Token,
     restrictions: Restrictions,
-    /// Name of the root module this parser originated from. If `None`, then the
-    /// name is not known. This does not change while the parser is descending
-    /// into modules, and sub-parsers have new values for this name.
-    pub root_module_name: Option<String>,
     expected_tokens: Vec<TokenType>,
     token_cursor: TokenCursor,
     desugar_doc_comments: bool,
@@ -350,7 +346,6 @@ impl<'a> Parser<'a> {
             token: Token::dummy(),
             prev_token: Token::dummy(),
             restrictions: Restrictions::empty(),
-            root_module_name: None,
             expected_tokens: Vec::new(),
             token_cursor: TokenCursor {
                 frame: TokenCursorFrame::new(DelimSpan::dummy(), token::NoDelim, &tokens),