From 34c02a6c0ead2896ecc68aa92dd39cd62aee5aea Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Sun, 24 Feb 2013 21:20:50 -0800 Subject: libsyntax: change Parser::unexpected_last to take &Token --- src/libsyntax/parse/common.rs | 4 ++-- src/libsyntax/parse/parser.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/parse/common.rs b/src/libsyntax/parse/common.rs index 4632ceb6e7d..af3779b3f39 100644 --- a/src/libsyntax/parse/common.rs +++ b/src/libsyntax/parse/common.rs @@ -51,12 +51,12 @@ pub fn token_to_str(reader: reader, token: &token::Token) -> ~str { } pub impl Parser { - fn unexpected_last(t: token::Token) -> ! { + fn unexpected_last(t: &token::Token) -> ! { self.span_fatal( *self.last_span, fmt!( "unexpected token: `%s`", - token_to_str(self.reader, &t) + token_to_str(self.reader, t) ) ); } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 9b825512c39..7f49cf4ae18 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -634,7 +634,7 @@ pub impl Parser { |p| p.parse_ty_field() ); if elems.len() == 0 { - self.unexpected_last(token::RBRACE); + self.unexpected_last(&token::RBRACE); } ty_rec(elems) } else if *self.token == token::LBRACKET { @@ -868,7 +868,7 @@ pub impl Parser { lit_float_unsuffixed(self.id_to_str(s)), token::LIT_STR(s) => lit_str(self.id_to_str(s)), token::LPAREN => { self.expect(&token::RPAREN); lit_nil }, - _ => { self.unexpected_last(*tok); } + _ => { self.unexpected_last(tok); } } } -- cgit 1.4.1-3-g733a5