Skip to content

Commit 34c02a6

Browse files
committed
libsyntax: change Parser::unexpected_last to take &Token
1 parent 28691a0 commit 34c02a6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libsyntax/parse/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ pub fn token_to_str(reader: reader, token: &token::Token) -> ~str {
5151
}
5252

5353
pub impl Parser {
54-
fn unexpected_last(t: token::Token) -> ! {
54+
fn unexpected_last(t: &token::Token) -> ! {
5555
self.span_fatal(
5656
*self.last_span,
5757
fmt!(
5858
"unexpected token: `%s`",
59-
token_to_str(self.reader, &t)
59+
token_to_str(self.reader, t)
6060
)
6161
);
6262
}

src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ pub impl Parser {
634634
|p| p.parse_ty_field()
635635
);
636636
if elems.len() == 0 {
637-
self.unexpected_last(token::RBRACE);
637+
self.unexpected_last(&token::RBRACE);
638638
}
639639
ty_rec(elems)
640640
} else if *self.token == token::LBRACKET {
@@ -868,7 +868,7 @@ pub impl Parser {
868868
lit_float_unsuffixed(self.id_to_str(s)),
869869
token::LIT_STR(s) => lit_str(self.id_to_str(s)),
870870
token::LPAREN => { self.expect(&token::RPAREN); lit_nil },
871-
_ => { self.unexpected_last(*tok); }
871+
_ => { self.unexpected_last(tok); }
872872
}
873873
}
874874

0 commit comments

Comments
 (0)