Skip to content

Commit 8f3ce86

Browse files
pcwaltonhuonw
authored andcommitted
---
yaml --- r: 107856 b: refs/heads/dist-snap c: 3c9e9d3 h: refs/heads/master v: v3
1 parent b0c498a commit 8f3ce86

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
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: cbf9f5f5dfd5e3ec36899adf89c55a20380da63e
9+
refs/heads/dist-snap: 3c9e9d35ac0f6469e0eeffc5c497f4b3ed6f1f8a
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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/dist-snap/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)