@@ -531,10 +531,11 @@ impl Parser {
531
531
// otherwise, eat it.
532
532
pub fn expect_keyword ( & mut self , kw : keywords:: Keyword ) {
533
533
if !self . eat_keyword ( kw) {
534
- let id_str = self . id_to_str ( kw. to_ident ( ) ) . to_str ( ) ;
534
+ let id_ident = kw. to_ident ( ) ;
535
+ let id_interned_str = token:: get_ident ( id_ident. name ) ;
535
536
let token_str = self . this_token_to_str ( ) ;
536
537
self . fatal ( format ! ( "expected `{}`, found `{}`" ,
537
- id_str ,
538
+ id_interned_str . get ( ) ,
538
539
token_str) )
539
540
}
540
541
}
@@ -802,10 +803,6 @@ impl Parser {
802
803
self . sess . span_diagnostic . handler ( ) . abort_if_errors ( ) ;
803
804
}
804
805
805
- pub fn id_to_str ( & mut self , id : Ident ) -> @str {
806
- get_ident_interner ( ) . get ( id. name )
807
- }
808
-
809
806
pub fn id_to_interned_str ( & mut self , id : Ident ) -> InternedString {
810
807
get_ident ( id. name )
811
808
}
@@ -3440,7 +3437,9 @@ impl Parser {
3440
3437
loop {
3441
3438
match self . token {
3442
3439
token:: LIFETIME ( lifetime) => {
3443
- if "static" == self . id_to_str ( lifetime) {
3440
+ let lifetime_interned_string =
3441
+ token:: get_ident ( lifetime. name ) ;
3442
+ if lifetime_interned_string. equiv ( & ( "static" ) ) {
3444
3443
result. push ( RegionTyParamBound ) ;
3445
3444
} else {
3446
3445
self . span_err ( self . span ,
@@ -4871,7 +4870,6 @@ impl Parser {
4871
4870
4872
4871
let first_ident = self . parse_ident ( ) ;
4873
4872
let mut path = ~[ first_ident] ;
4874
- debug ! ( "parsed view path: {}" , self . id_to_str( first_ident) ) ;
4875
4873
match self . token {
4876
4874
token:: EQ => {
4877
4875
// x = foo::bar
0 commit comments