about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorJohn Clements <clements@racket-lang.org>2013-02-13 12:49:45 -0800
committerJohn Clements <clements@racket-lang.org>2013-02-13 15:08:27 -0800
commit9d962d84669a02805571683707cec712415af4c6 (patch)
tree9ac8bd742371618f82da50f67ff14a416e11bdb5 /src/libsyntax
parentded95d2c2891d7ffec1277cb4969ed956ff0bd25 (diff)
downloadrust-9d962d84669a02805571683707cec712415af4c6.tar.gz
rust-9d962d84669a02805571683707cec712415af4c6.zip
add test case
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 19de5cc62f3..36c8c29ded8 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -152,6 +152,8 @@ pub type crate_cfg = ~[@meta_item];
 
 pub type crate = spanned<crate_>;
 
+#[auto_encode]
+#[auto_decode]
 #[deriving_eq]
 pub struct crate_ {
     module: _mod,
@@ -1281,7 +1283,34 @@ pub enum inlined_item {
     ii_dtor(struct_dtor, ident, ~[ty_param], def_id /* parent id */)
 }
 
-
+#[cfg(test)]
+mod test {
+    use std;
+    use codemap::*;
+    use super::*;
+
+    //are asts encodable?
+
+    // it looks like this *will* be a compiler bug, after
+    // I get deriving_eq for crates into incoming :)
+    /*
+    #[test] fn check_asts_encodable() {
+        let bogus_span = span {lo:BytePos(10),
+                               hi:BytePos(20),
+                               expn_info:None};
+        let _e : crate =
+            spanned{
+            node: crate_{
+                module: _mod {view_items: ~[], items: ~[]},
+                attrs: ~[],
+                config: ~[]
+            },
+            span: bogus_span};
+        // doesn't matter which encoder we use....
+        let _f = (_e as std::serialize::Encodable::<std::json::Encoder>);
+    }
+    */
+}
 //
 // Local Variables:
 // mode: rust