@@ -656,7 +656,7 @@ pub impl Parser {
656
656
} else if self.token_is_closure_keyword(© *self.token) {
657
657
self.parse_ty_closure(None, None)
658
658
} else if *self.token == token::MOD_SEP
659
- || is_ident_or_path(*self.token) {
659
+ || is_ident_or_path(& *self.token) {
660
660
let path = self.parse_path_with_tps(colons_before_params);
661
661
ty_path(path, self.get_id())
662
662
} else {
@@ -760,10 +760,10 @@ pub impl Parser {
760
760
}
761
761
} else { 0 } ;
762
762
if offset == 0 {
763
- is_plain_ident ( * self . token )
763
+ is_plain_ident ( & * self . token )
764
764
&& self . look_ahead ( 1 ) == token:: COLON
765
765
} else {
766
- is_plain_ident ( self . look_ahead ( offset) )
766
+ is_plain_ident ( & self . look_ahead ( offset) )
767
767
&& self . look_ahead ( offset + 1 ) == token:: COLON
768
768
}
769
769
}
@@ -1141,7 +1141,7 @@ pub impl Parser {
1141
1141
return self . mk_expr ( blk. span . lo , blk. span . hi ,
1142
1142
expr_block ( blk) ) ;
1143
1143
}
1144
- } else if token:: is_bar ( * self . token ) {
1144
+ } else if token:: is_bar ( & * self . token ) {
1145
1145
return self . parse_lambda_expr ( ) ;
1146
1146
} else if self . eat_keyword ( & ~"if ") {
1147
1147
return self.parse_if_expr();
@@ -1215,13 +1215,13 @@ pub impl Parser {
1215
1215
ex = expr_assert ( e) ;
1216
1216
hi = e. span . hi ;
1217
1217
} else if self . eat_keyword ( & ~"return ") {
1218
- if can_begin_expr(*self.token) {
1218
+ if can_begin_expr(& *self.token) {
1219
1219
let e = self.parse_expr();
1220
1220
hi = e.span.hi;
1221
1221
ex = expr_ret(Some(e));
1222
1222
} else { ex = expr_ret(None); }
1223
1223
} else if self.eat_keyword(&~"break" ) {
1224
- if is_ident ( * self . token ) {
1224
+ if is_ident ( & * self . token ) {
1225
1225
ex = expr_break ( Some ( self . parse_ident ( ) ) ) ;
1226
1226
} else {
1227
1227
ex = expr_break ( None ) ;
@@ -1232,7 +1232,7 @@ pub impl Parser {
1232
1232
ex = expr_copy ( e) ;
1233
1233
hi = e. span . hi ;
1234
1234
} else if * self . token == token:: MOD_SEP ||
1235
- is_ident ( * self . token ) && !self . is_keyword ( & ~"true ") &&
1235
+ is_ident ( & * self . token ) && !self . is_keyword ( & ~"true ") &&
1236
1236
!self . is_keyword ( & ~"false ") {
1237
1237
let pth = self . parse_path_with_tps ( true ) ;
1238
1238
@@ -1914,11 +1914,11 @@ pub impl Parser {
1914
1914
// loop headers look like 'loop {' or 'loop unsafe {'
1915
1915
let is_loop_header =
1916
1916
* self . token == token:: LBRACE
1917
- || ( is_ident ( * self . token )
1917
+ || ( is_ident ( & * self . token )
1918
1918
&& self . look_ahead ( 1 ) == token:: LBRACE ) ;
1919
1919
// labeled loop headers look like 'loop foo: {'
1920
1920
let is_labeled_loop_header =
1921
- is_ident ( * self . token )
1921
+ is_ident ( & * self . token )
1922
1922
&& !self . is_any_keyword ( & copy * self . token )
1923
1923
&& self . look_ahead ( 1 ) == token:: COLON ;
1924
1924
@@ -1939,7 +1939,7 @@ pub impl Parser {
1939
1939
} else {
1940
1940
// This is a 'continue' expression
1941
1941
let lo = self . span . lo ;
1942
- let ex = if is_ident ( * self . token ) {
1942
+ let ex = if is_ident ( & * self . token ) {
1943
1943
expr_again ( Some ( self . parse_ident ( ) ) )
1944
1944
} else {
1945
1945
expr_again ( None )
@@ -1954,7 +1954,7 @@ pub impl Parser {
1954
1954
let lookahead = self . look_ahead ( 1 ) ;
1955
1955
* self . token == token:: LBRACE &&
1956
1956
( self . token_is_keyword ( & ~"mut ", &lookahead) ||
1957
- (is_plain_ident(lookahead) &&
1957
+ (is_plain_ident(& lookahead) &&
1958
1958
self.look_ahead(2) == token::COLON))
1959
1959
}
1960
1960
@@ -2260,7 +2260,7 @@ pub impl Parser {
2260
2260
pat = ast:: pat_vec ( elements, tail) ;
2261
2261
}
2262
2262
copy tok => {
2263
- if !is_ident_or_path ( tok)
2263
+ if !is_ident_or_path ( & tok)
2264
2264
|| self . is_keyword ( & ~"true ")
2265
2265
|| self . is_keyword ( & ~"false ")
2266
2266
{
@@ -2290,7 +2290,7 @@ pub impl Parser {
2290
2290
cannot_be_enum_or_struct = true
2291
2291
}
2292
2292
2293
- if is_plain_ident ( * self . token ) && cannot_be_enum_or_struct {
2293
+ if is_plain_ident ( & * self . token ) && cannot_be_enum_or_struct {
2294
2294
let name = self . parse_value_path ( ) ;
2295
2295
let sub;
2296
2296
if self . eat ( & token:: AT ) {
@@ -2359,7 +2359,7 @@ pub impl Parser {
2359
2359
2360
2360
fn parse_pat_ident( refutable: bool ,
2361
2361
binding_mode: ast:: binding_mode) -> ast:: pat_ {
2362
- if !is_plain_ident ( * self . token ) {
2362
+ if !is_plain_ident ( & * self . token ) {
2363
2363
self . span_fatal (
2364
2364
* self . last_span ,
2365
2365
~"expected identifier, found path") ;
@@ -2425,7 +2425,7 @@ pub impl Parser {
2425
2425
if self . eat_keyword ( & ~"mut ") {
2426
2426
is_mutbl = struct_mutable;
2427
2427
}
2428
- if !is_plain_ident(*self.token) {
2428
+ if !is_plain_ident(& *self.token) {
2429
2429
self.fatal(~" expected ident") ;
2430
2430
}
2431
2431
let name = self . parse_ident ( ) ;
@@ -2454,7 +2454,7 @@ pub impl Parser {
2454
2454
self.expect_keyword(&~" let") ;
2455
2455
let decl = self . parse_let ( ) ;
2456
2456
return @spanned ( lo, decl. span . hi , stmt_decl ( decl, self . get_id ( ) ) ) ;
2457
- } else if is_ident ( * self . token )
2457
+ } else if is_ident ( & * self . token )
2458
2458
&& !self . is_any_keyword ( & copy * self . token )
2459
2459
&& self . look_ahead ( 1 ) == token:: NOT {
2460
2460
@@ -2716,7 +2716,7 @@ pub impl Parser {
2716
2716
~"`& static ` is the only permissible \
2717
2717
region bound here") ;
2718
2718
}
2719
- } else if is_ident ( * self . token ) {
2719
+ } else if is_ident ( & * self . token ) {
2720
2720
let maybe_bound = match * self . token {
2721
2721
token:: IDENT ( copy sid, _) => {
2722
2722
match * self . id_to_str ( sid) {
@@ -2757,7 +2757,7 @@ pub impl Parser {
2757
2757
loop ;
2758
2758
}
2759
2759
2760
- if is_ident_or_path ( * self . token ) {
2760
+ if is_ident_or_path ( & * self . token ) {
2761
2761
self . obsolete ( * self . span ,
2762
2762
ObsoleteTraitBoundSeparator ) ;
2763
2763
}
@@ -3987,7 +3987,7 @@ pub impl Parser {
3987
3987
} ) ;
3988
3988
} else if macros_allowed && !self . is_any_keyword ( & copy * self . token )
3989
3989
&& self . look_ahead ( 1 ) == token:: NOT
3990
- && ( is_plain_ident ( self . look_ahead ( 2 ) )
3990
+ && ( is_plain_ident ( & self . look_ahead ( 2 ) )
3991
3991
|| self . look_ahead ( 2 ) == token:: LPAREN
3992
3992
|| self . look_ahead ( 2 ) == token:: LBRACE ) {
3993
3993
// MACRO INVOCATION ITEM
@@ -4002,7 +4002,7 @@ pub impl Parser {
4002
4002
// a 'special' identifier (like what `macro_rules!` uses)
4003
4003
// is optional. We should eventually unify invoc syntax
4004
4004
// and remove this.
4005
- let id = if is_plain_ident ( * self . token ) {
4005
+ let id = if is_plain_ident ( & * self . token ) {
4006
4006
self . parse_ident ( )
4007
4007
} else {
4008
4008
token:: special_idents:: invalid // no special identifier
0 commit comments