about summary refs log tree commit diff
path: root/src/libsyntax/tokenstream.rs
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-12-07 00:28:51 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-12-07 10:56:55 +0000
commitfd98a8d795b17b76ea6d1edcae55d4450efd466f (patch)
treeae51c9d40290d78d68ab07675747205eacfd8768 /src/libsyntax/tokenstream.rs
parentdaf8c1dfce3b448fc581cc319f64632ec22bd0e1 (diff)
downloadrust-fd98a8d795b17b76ea6d1edcae55d4450efd466f.tar.gz
rust-fd98a8d795b17b76ea6d1edcae55d4450efd466f.zip
macros: fix the expected paths for a non-inline module matched by an `item` fragment.
Diffstat (limited to 'src/libsyntax/tokenstream.rs')
-rw-r--r--src/libsyntax/tokenstream.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libsyntax/tokenstream.rs b/src/libsyntax/tokenstream.rs
index 0d5dcaf339f..e352e7853c7 100644
--- a/src/libsyntax/tokenstream.rs
+++ b/src/libsyntax/tokenstream.rs
@@ -31,7 +31,7 @@ use ext::base;
 use ext::tt::macro_parser;
 use parse::lexer::comments::{doc_comment_style, strip_doc_comment_decoration};
 use parse::lexer;
-use parse;
+use parse::{self, Directory};
 use parse::token::{self, Token, Lit, Nonterminal};
 use print::pprust;
 use symbol::Symbol;
@@ -218,7 +218,11 @@ impl TokenTree {
         let diag = &cx.parse_sess().span_diagnostic;
         // `None` is because we're not interpolating
         let arg_rdr = lexer::new_tt_reader(diag, None, tts.iter().cloned().collect());
-        macro_parser::parse(cx.parse_sess(), arg_rdr, mtch)
+        let directory = Directory {
+            path: cx.current_expansion.module.directory.clone(),
+            ownership: cx.current_expansion.directory_ownership,
+        };
+        macro_parser::parse(cx.parse_sess(), arg_rdr, mtch, Some(directory))
     }
 
     /// Check if this TokenTree is equal to the other, regardless of span information.