mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
librustc: De-@str
ident()
and str_of()
This commit is contained in:
parent
19d4ea1cba
commit
21f86855dd
@ -352,9 +352,11 @@ impl Session_ {
|
||||
self.debugging_opt(NO_LANDING_PADS)
|
||||
}
|
||||
|
||||
// pointless function, now...
|
||||
pub fn str_of(&self, id: ast::Ident) -> @str {
|
||||
token::ident_to_str(&id)
|
||||
// DEPRECATED. This function results in a lot of allocations when they
|
||||
// are not necessary.
|
||||
pub fn str_of(&self, id: ast::Ident) -> ~str {
|
||||
let string = token::get_ident(id.name);
|
||||
string.get().to_str()
|
||||
}
|
||||
|
||||
// pointless function, now...
|
||||
|
@ -176,8 +176,8 @@ fn check_exhaustive(cx: &MatchCheckCtxt, sp: Span, pats: ~[@Pat]) {
|
||||
match ty::get(ty).sty {
|
||||
ty::ty_bool => {
|
||||
match *ctor {
|
||||
val(const_bool(true)) => Some(@"true"),
|
||||
val(const_bool(false)) => Some(@"false"),
|
||||
val(const_bool(true)) => Some(~"true"),
|
||||
val(const_bool(false)) => Some(~"false"),
|
||||
_ => None
|
||||
}
|
||||
}
|
||||
@ -197,7 +197,7 @@ fn check_exhaustive(cx: &MatchCheckCtxt, sp: Span, pats: ~[@Pat]) {
|
||||
}
|
||||
ty::ty_unboxed_vec(..) | ty::ty_vec(..) => {
|
||||
match *ctor {
|
||||
vec(n) => Some(format!("vectors of length {}", n).to_managed()),
|
||||
vec(n) => Some(format!("vectors of length {}", n)),
|
||||
_ => None
|
||||
}
|
||||
}
|
||||
|
@ -446,8 +446,9 @@ impl<'a> Block<'a> {
|
||||
}
|
||||
pub fn sess(&self) -> Session { self.fcx.ccx.sess }
|
||||
|
||||
pub fn ident(&self, ident: Ident) -> @str {
|
||||
token::ident_to_str(&ident)
|
||||
pub fn ident(&self, ident: Ident) -> ~str {
|
||||
let string = token::get_ident(ident.name);
|
||||
string.get().to_str()
|
||||
}
|
||||
|
||||
pub fn node_id_to_str(&self, id: ast::NodeId) -> ~str {
|
||||
|
Loading…
Reference in New Issue
Block a user