Skip to content

Commit 6e8e93a

Browse files
pcwaltonhuonw
authored andcommitted
---
yaml --- r: 107865 b: refs/heads/dist-snap c: e9ce855 h: refs/heads/master i: 107863: b46fe2e v: v3
1 parent be43d72 commit 6e8e93a

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
@@ -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: b265dd4156578800fa1171e615638cd86f517042
9+
refs/heads/dist-snap: e9ce855beb599b7b7c53979ade57d3831f1c4a82
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

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