borrowck changes: some copies, some removed mut annotations, some dvec

This commit is contained in:
Niko Matsakis
2012-06-03 07:36:40 -07:00
parent c3b266f50f
commit 45680c83ab
5 changed files with 42 additions and 40 deletions

View File

@@ -18,7 +18,7 @@ fn seq_sep_none() -> seq_sep {
}
fn token_to_str(reader: reader, token: token::token) -> str {
fn token_to_str(reader: reader, ++token: token::token) -> str {
token::to_str(*reader.interner, token)
}
@@ -27,8 +27,9 @@ fn token_to_str(reader: reader, token: token::token) -> str {
impl parser_common for parser {
fn unexpected_last(t: token::token) -> ! {
self.span_fatal(self.last_span, "unexpected token: '"
+ token_to_str(self.reader, t) + "'");
self.span_fatal(
copy self.last_span,
"unexpected token: '" + token_to_str(self.reader, t) + "'");
}
fn unexpected() -> ! {
@@ -49,7 +50,7 @@ impl parser_common for parser {
}
fn parse_ident() -> ast::ident {
alt self.token {
alt copy self.token {
token::IDENT(i, _) { self.bump(); ret self.get_str(i); }
_ { self.fatal("expecting ident, found "
+ token_to_str(self.reader, self.token)); }
@@ -79,7 +80,7 @@ impl parser_common for parser {
}
}
fn token_is_keyword(word: str, tok: token::token) -> bool {
fn token_is_keyword(word: str, ++tok: token::token) -> bool {
self.require_keyword(word);
alt tok {
token::IDENT(sid, false) { str::eq(word, self.get_str(sid)) }
@@ -93,7 +94,7 @@ impl parser_common for parser {
fn eat_keyword(word: str) -> bool {
self.require_keyword(word);
alt self.token {
alt copy self.token {
token::IDENT(sid, false) {
if str::eq(word, self.get_str(sid)) {
self.bump();