@@ -41,7 +41,7 @@ use syntax::print::pprust;
41
41
use syntax::diagnostic;
42
42
43
43
enum test_mode { tm_converge, tm_run, }
44
- type context = { mode: test_mode }; // + rng
44
+ struct Context { mode: test_mode } // + rng
45
45
46
46
impl test_mode : cmp::Eq {
47
47
pure fn eq(&self, other: &test_mode) -> bool {
@@ -166,9 +166,9 @@ fn stash_ty_if(c: fn@(@ast::Ty, test_mode)->bool,
166
166
} else {/* now my indices are wrong :( */ }
167
167
}
168
168
169
- type stolen_stuff = {exprs: ~[ast::expr], tys: ~[ast::Ty]};
169
+ struct StolenStuff {exprs: ~[ast::expr], tys: ~[ast::Ty]}
170
170
171
- fn steal(crate: ast::crate, tm: test_mode) -> stolen_stuff {
171
+ fn steal(crate: ast::crate, tm: test_mode) -> StolenStuff {
172
172
let exprs = @mut ~[];
173
173
let tys = @mut ~[];
174
174
let v = visit::mk_simple_visitor(@visit::SimpleVisitor {
@@ -177,7 +177,7 @@ fn steal(crate: ast::crate, tm: test_mode) -> stolen_stuff {
177
177
.. *visit::default_simple_visitor()
178
178
});
179
179
visit::visit_crate(crate, (), v);
180
- {exprs: *exprs, tys: *tys}
180
+ StolenStuff {exprs: *exprs, tys: *tys}
181
181
}
182
182
183
183
@@ -264,7 +264,7 @@ fn as_str(f: fn@(+x: io::Writer)) -> ~str {
264
264
}
265
265
266
266
fn check_variants_of_ast(crate: ast::crate, codemap: @codemap::CodeMap,
267
- filename: &Path, cx: context ) {
267
+ filename: &Path, cx: Context ) {
268
268
let stolen = steal(crate, cx.mode);
269
269
let extra_exprs = do common_exprs().filtered |a| {
270
270
safe_to_use_expr(*a, cx.mode)
@@ -284,7 +284,7 @@ fn check_variants_T<T: Copy>(
284
284
things: ~[T],
285
285
stringifier: fn@(@T, @syntax::parse::token::ident_interner) -> ~str,
286
286
replacer: fn@(ast::crate, uint, T, test_mode) -> ast::crate,
287
- cx: context
287
+ cx: Context
288
288
) {
289
289
error!("%s contains %u %s objects", filename.to_str(),
290
290
things.len(), thing_label);
@@ -594,7 +594,7 @@ fn check_convergence(files: &[Path]) {
594
594
}
595
595
}
596
596
597
- fn check_variants(files: &[Path], cx: context ) {
597
+ fn check_variants(files: &[Path], cx: Context ) {
598
598
for files.each |file| {
599
599
if cx.mode == tm_converge &&
600
600
file_might_not_converge(file) {
@@ -652,9 +652,9 @@ fn main() {
652
652
error!("== check_convergence ==");
653
653
check_convergence(files);
654
654
error!("== check_variants: converge ==");
655
- check_variants(files, { mode: tm_converge });
655
+ check_variants(files, Context { mode: tm_converge });
656
656
error!("== check_variants: run ==");
657
- check_variants(files, { mode: tm_run });
657
+ check_variants(files, Context { mode: tm_run });
658
658
659
659
error!("Fuzzer done");
660
660
}
0 commit comments