libsyntax: De-@mut Parser::mod_path_stack

This commit is contained in:
Patrick Walton 2013-12-30 15:38:02 -08:00
parent e0a5460e94
commit a2f4877862

View File

@ -317,7 +317,7 @@ pub fn Parser(sess: @mut ParseSess, cfg: ast::CrateConfig, rdr: @mut reader)
restriction: UNRESTRICTED,
quote_depth: 0,
obsolete_set: HashSet::new(),
mod_path_stack: @mut ~[],
mod_path_stack: ~[],
open_braces: @mut ~[],
non_copyable: util::NonCopyable
}
@ -347,7 +347,7 @@ pub struct Parser {
/// extra detail when the same error is seen twice
obsolete_set: HashSet<ObsoleteSyntax>,
/// Used to determine the path to externally loaded source files
mod_path_stack: @mut ~[@str],
mod_path_stack: ~[@str],
/// Stack of spans of open delimiters. Used for error message.
open_braces: @mut ~[Span],
/* do not copy the parser; its state is tied to outside state */
@ -4223,8 +4223,7 @@ impl Parser {
-> (ast::item_, ~[ast::Attribute]) {
let mut prefix = Path::new(self.sess.cm.span_to_filename(self.span));
prefix.pop();
let mod_path_stack = &*self.mod_path_stack;
let mod_path = Path::new(".").join_many(*mod_path_stack);
let mod_path = Path::new(".").join_many(self.mod_path_stack);
let dir_path = prefix.join(&mod_path);
let file_path = match ::attr::first_attr_value_str_by_name(
outer_attrs, "path") {