Skip to content

Commit 0beed3b

Browse files
committed
libsyntax: De-@mut Parser::mod_path_stack
1 parent 75edbf4 commit 0beed3b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ pub fn Parser(sess: @mut ParseSess, cfg: ast::CrateConfig, rdr: @mut reader)
317317
restriction: UNRESTRICTED,
318318
quote_depth: 0,
319319
obsolete_set: HashSet::new(),
320-
mod_path_stack: @mut ~[],
320+
mod_path_stack: ~[],
321321
open_braces: @mut ~[],
322322
non_copyable: util::NonCopyable
323323
}
@@ -347,7 +347,7 @@ pub struct Parser {
347347
/// extra detail when the same error is seen twice
348348
obsolete_set: HashSet<ObsoleteSyntax>,
349349
/// Used to determine the path to externally loaded source files
350-
mod_path_stack: @mut ~[@str],
350+
mod_path_stack: ~[@str],
351351
/// Stack of spans of open delimiters. Used for error message.
352352
open_braces: @mut ~[Span],
353353
/* do not copy the parser; its state is tied to outside state */
@@ -4223,8 +4223,7 @@ impl Parser {
42234223
-> (ast::item_, ~[ast::Attribute]) {
42244224
let mut prefix = Path::new(self.sess.cm.span_to_filename(self.span));
42254225
prefix.pop();
4226-
let mod_path_stack = &*self.mod_path_stack;
4227-
let mod_path = Path::new(".").join_many(*mod_path_stack);
4226+
let mod_path = Path::new(".").join_many(self.mod_path_stack);
42284227
let dir_path = prefix.join(&mod_path);
42294228
let file_path = match ::attr::first_attr_value_str_by_name(
42304229
outer_attrs, "path") {

0 commit comments

Comments
 (0)