Skip to content

Commit cceb846

Browse files
pcwaltonhuonw
authored andcommitted
---
yaml --- r: 102541 b: refs/heads/auto c: 21f8685 h: refs/heads/master i: 102539: a8feacf v: v3
1 parent ef288fd commit cceb846

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
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: 19d4ea1cbade2e261a783131ea5a9f30426ef36f
16+
refs/heads/auto: 21f86855ddd8231b28b2c89bbcf7f9a7ed1324a4
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc/driver/session.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,11 @@ impl Session_ {
352352
self.debugging_opt(NO_LANDING_PADS)
353353
}
354354

355-
// pointless function, now...
356-
pub fn str_of(&self, id: ast::Ident) -> @str {
357-
token::ident_to_str(&id)
355+
// DEPRECATED. This function results in a lot of allocations when they
356+
// are not necessary.
357+
pub fn str_of(&self, id: ast::Ident) -> ~str {
358+
let string = token::get_ident(id.name);
359+
string.get().to_str()
358360
}
359361

360362
// pointless function, now...

branches/auto/src/librustc/middle/check_match.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ fn check_exhaustive(cx: &MatchCheckCtxt, sp: Span, pats: ~[@Pat]) {
176176
match ty::get(ty).sty {
177177
ty::ty_bool => {
178178
match *ctor {
179-
val(const_bool(true)) => Some(@"true"),
180-
val(const_bool(false)) => Some(@"false"),
179+
val(const_bool(true)) => Some(~"true"),
180+
val(const_bool(false)) => Some(~"false"),
181181
_ => None
182182
}
183183
}
@@ -197,7 +197,7 @@ fn check_exhaustive(cx: &MatchCheckCtxt, sp: Span, pats: ~[@Pat]) {
197197
}
198198
ty::ty_unboxed_vec(..) | ty::ty_vec(..) => {
199199
match *ctor {
200-
vec(n) => Some(format!("vectors of length {}", n).to_managed()),
200+
vec(n) => Some(format!("vectors of length {}", n)),
201201
_ => None
202202
}
203203
}

branches/auto/src/librustc/middle/trans/common.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,9 @@ impl<'a> Block<'a> {
446446
}
447447
pub fn sess(&self) -> Session { self.fcx.ccx.sess }
448448

449-
pub fn ident(&self, ident: Ident) -> @str {
450-
token::ident_to_str(&ident)
449+
pub fn ident(&self, ident: Ident) -> ~str {
450+
let string = token::get_ident(ident.name);
451+
string.get().to_str()
451452
}
452453

453454
pub fn node_id_to_str(&self, id: ast::NodeId) -> ~str {

0 commit comments

Comments
 (0)