Skip to content

Commit 05ca051

Browse files
pcwaltonhuonw
authored andcommitted
---
yaml --- r: 102538 b: refs/heads/auto c: e9ce855 h: refs/heads/master v: v3
1 parent d4eabeb commit 05ca051

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
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: b265dd4156578800fa1171e615638cd86f517042
16+
refs/heads/auto: e9ce855beb599b7b7c53979ade57d3831f1c4a82
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ use std::vec;
120120
use syntax::ast::*;
121121
use syntax::codemap::Span;
122122
use syntax::parse::token::special_idents;
123+
use syntax::parse::token;
123124
use syntax::print::pprust::{expr_to_str, block_to_str};
124125
use syntax::{visit, ast_util};
125126
use syntax::visit::{Visitor, FnKind};
@@ -332,13 +333,14 @@ impl IrMaps {
332333
}
333334
}
334335

335-
pub fn variable_name(&self, var: Variable) -> @str {
336+
pub fn variable_name(&self, var: Variable) -> ~str {
336337
let var_kinds = self.var_kinds.borrow();
337338
match var_kinds.get()[var.get()] {
338339
Local(LocalInfo { ident: nm, .. }) | Arg(_, nm) => {
339-
self.tcx.sess.str_of(nm)
340+
let string = token::get_ident(nm.name);
341+
string.get().to_str()
340342
},
341-
ImplicitRet => @"<implicit-ret>"
343+
ImplicitRet => ~"<implicit-ret>"
342344
}
343345
}
344346
@@ -1669,7 +1671,7 @@ impl Liveness {
16691671
}
16701672
}
16711673

1672-
pub fn should_warn(&self, var: Variable) -> Option<@str> {
1674+
pub fn should_warn(&self, var: Variable) -> Option<~str> {
16731675
let name = self.ir.variable_name(var);
16741676
if name.len() == 0 || name[0] == ('_' as u8) { None } else { Some(name) }
16751677
}

0 commit comments

Comments
 (0)