Skip to content

Commit 3c7bb3e

Browse files
committed
---
yaml --- r: 44431 b: refs/heads/master c: 9d962d8 h: refs/heads/master i: 44429: 7c1c2a7 44427: 8e6e197 44423: 23079d8 44415: 253ff59 v: v3
1 parent 997117b commit 3c7bb3e

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: ded95d2c2891d7ffec1277cb4969ed956ff0bd25
2+
refs/heads/master: 9d962d84669a02805571683707cec712415af4c6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/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)