Skip to content

Commit 9d962d8

Browse files
committed
add test case
1 parent ded95d2 commit 9d962d8

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

src/libsyntax/ast.rs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ pub type crate_cfg = ~[@meta_item];
152152
153153
pub type crate = spanned<crate_>;
154154
155+
#[auto_encode]
156+
#[auto_decode]
155157
#[deriving_eq]
156158
pub struct crate_ {
157159
module: _mod,
@@ -1281,7 +1283,34 @@ pub enum inlined_item {
12811283
ii_dtor(struct_dtor, ident, ~[ty_param], def_id /* parent id */)
12821284
}
12831285

1284-
1286+
#[cfg(test)]
1287+
mod test {
1288+
use std;
1289+
use codemap::*;
1290+
use super::*;
1291+
1292+
//are asts encodable?
1293+
1294+
// it looks like this *will* be a compiler bug, after
1295+
// I get deriving_eq for crates into incoming :)
1296+
/*
1297+
#[test] fn check_asts_encodable() {
1298+
let bogus_span = span {lo:BytePos(10),
1299+
hi:BytePos(20),
1300+
expn_info:None};
1301+
let _e : crate =
1302+
spanned{
1303+
node: crate_{
1304+
module: _mod {view_items: ~[], items: ~[]},
1305+
attrs: ~[],
1306+
config: ~[]
1307+
},
1308+
span: bogus_span};
1309+
// doesn't matter which encoder we use....
1310+
let _f = (_e as std::serialize::Encodable::<std::json::Encoder>);
1311+
}
1312+
*/
1313+
}
12851314
//
12861315
// Local Variables:
12871316
// mode: rust

0 commit comments

Comments
 (0)