Skip to content

Commit 09b189d

Browse files
pcwaltonhuonw
authored andcommitted
---
yaml --- r: 102529 b: refs/heads/auto c: 3c9e9d3 h: refs/heads/master i: 102527: 17c407c v: v3
1 parent 0363ed4 commit 09b189d

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: cbf9f5f5dfd5e3ec36899adf89c55a20380da63e
16+
refs/heads/auto: 3c9e9d35ac0f6469e0eeffc5c497f4b3ed6f1f8a
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libsyntax/parse/obsolete.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use codemap::{Span, respan};
2222
use parse::parser::Parser;
2323
use parse::token;
2424

25-
use std::str;
2625
use std::to_bytes;
2726

2827
/// The specific types of unsupported syntax
@@ -178,7 +177,8 @@ impl ParserObsoleteMethods for Parser {
178177
fn is_obsolete_ident(&mut self, ident: &str) -> bool {
179178
match self.token {
180179
token::IDENT(sid, _) => {
181-
str::eq_slice(self.id_to_str(sid), ident)
180+
let interned_string = token::get_ident(sid.name);
181+
interned_string.equiv(&ident)
182182
}
183183
_ => false
184184
}

branches/auto/src/libsyntax/parse/parser.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -531,10 +531,11 @@ impl Parser {
531531
// otherwise, eat it.
532532
pub fn expect_keyword(&mut self, kw: keywords::Keyword) {
533533
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);
535536
let token_str = self.this_token_to_str();
536537
self.fatal(format!("expected `{}`, found `{}`",
537-
id_str,
538+
id_interned_str.get(),
538539
token_str))
539540
}
540541
}
@@ -802,10 +803,6 @@ impl Parser {
802803
self.sess.span_diagnostic.handler().abort_if_errors();
803804
}
804805

805-
pub fn id_to_str(&mut self, id: Ident) -> @str {
806-
get_ident_interner().get(id.name)
807-
}
808-
809806
pub fn id_to_interned_str(&mut self, id: Ident) -> InternedString {
810807
get_ident(id.name)
811808
}
@@ -3440,7 +3437,9 @@ impl Parser {
34403437
loop {
34413438
match self.token {
34423439
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")) {
34443443
result.push(RegionTyParamBound);
34453444
} else {
34463445
self.span_err(self.span,
@@ -4871,7 +4870,6 @@ impl Parser {
48714870

48724871
let first_ident = self.parse_ident();
48734872
let mut path = ~[first_ident];
4874-
debug!("parsed view path: {}", self.id_to_str(first_ident));
48754873
match self.token {
48764874
token::EQ => {
48774875
// x = foo::bar

0 commit comments

Comments
 (0)