Skip to content

Commit fa71997

Browse files
committed
Add to_str() definitions for some AST types
1 parent e964006 commit fa71997

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/libsyntax/ast.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,12 @@ enum trait_method {
973973
#[auto_decode]
974974
enum int_ty { ty_i, ty_char, ty_i8, ty_i16, ty_i32, ty_i64, }
975975

976+
impl int_ty : ToStr {
977+
pure fn to_str() -> ~str {
978+
::ast_util::int_ty_to_str(self)
979+
}
980+
}
981+
976982
impl int_ty : to_bytes::IterBytes {
977983
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
978984
(*self as u8).iter_bytes(lsb0, f)
@@ -1003,6 +1009,12 @@ impl int_ty : cmp::Eq {
10031009
#[auto_decode]
10041010
enum uint_ty { ty_u, ty_u8, ty_u16, ty_u32, ty_u64, }
10051011

1012+
impl uint_ty : ToStr {
1013+
pure fn to_str() -> ~str {
1014+
::ast_util::uint_ty_to_str(self)
1015+
}
1016+
}
1017+
10061018
impl uint_ty : to_bytes::IterBytes {
10071019
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
10081020
(*self as u8).iter_bytes(lsb0, f)
@@ -1031,6 +1043,12 @@ impl uint_ty : cmp::Eq {
10311043
#[auto_decode]
10321044
enum float_ty { ty_f, ty_f32, ty_f64, }
10331045

1046+
impl float_ty : ToStr {
1047+
pure fn to_str() -> ~str {
1048+
::ast_util::float_ty_to_str(self)
1049+
}
1050+
}
1051+
10341052
impl float_ty : to_bytes::IterBytes {
10351053
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
10361054
(*self as u8).iter_bytes(lsb0, f)

0 commit comments

Comments
 (0)