about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2013-01-22 07:01:43 -0800
committerNiko Matsakis <niko@alum.mit.edu>2013-01-28 10:01:59 -0800
commit19e015c44a9f5b911ac7ffa105395d442ece8fda (patch)
tree1b41e9ef7010ff75893f85fe3d4637c92f2166c6 /src/libsyntax
parent08bc19cbcd2638f41a5a613150b3d8a7d32072ea (diff)
downloadrust-19e015c44a9f5b911ac7ffa105395d442ece8fda.tar.gz
rust-19e015c44a9f5b911ac7ffa105395d442ece8fda.zip
Add to_str() definitions for some AST types
r=brson
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 65216e55493..502a372b330 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -973,6 +973,12 @@ enum trait_method {
 #[auto_decode]
 enum int_ty { ty_i, ty_char, ty_i8, ty_i16, ty_i32, ty_i64, }
 
+impl int_ty : ToStr {
+    pure fn to_str() -> ~str {
+        ::ast_util::int_ty_to_str(self)
+    }
+}
+
 impl int_ty : to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         (*self as u8).iter_bytes(lsb0, f)
@@ -1003,6 +1009,12 @@ impl int_ty : cmp::Eq {
 #[auto_decode]
 enum uint_ty { ty_u, ty_u8, ty_u16, ty_u32, ty_u64, }
 
+impl uint_ty : ToStr {
+    pure fn to_str() -> ~str {
+        ::ast_util::uint_ty_to_str(self)
+    }
+}
+
 impl uint_ty : to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         (*self as u8).iter_bytes(lsb0, f)
@@ -1031,6 +1043,12 @@ impl uint_ty : cmp::Eq {
 #[auto_decode]
 enum float_ty { ty_f, ty_f32, ty_f64, }
 
+impl float_ty : ToStr {
+    pure fn to_str() -> ~str {
+        ::ast_util::float_ty_to_str(self)
+    }
+}
+
 impl float_ty : to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         (*self as u8).iter_bytes(lsb0, f)