Skip to content

Commit 72b669d

Browse files
committed
fuzzer: Remove structural records
1 parent e910e60 commit 72b669d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/libfuzzer/fuzzer.rc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use syntax::print::pprust;
4141
use syntax::diagnostic;
4242

4343
enum test_mode { tm_converge, tm_run, }
44-
type context = { mode: test_mode }; // + rng
44+
struct Context { mode: test_mode } // + rng
4545

4646
impl test_mode : cmp::Eq {
4747
pure fn eq(&self, other: &test_mode) -> bool {
@@ -166,9 +166,9 @@ fn stash_ty_if(c: fn@(@ast::Ty, test_mode)->bool,
166166
} else {/* now my indices are wrong :( */ }
167167
}
168168

169-
type stolen_stuff = {exprs: ~[ast::expr], tys: ~[ast::Ty]};
169+
struct StolenStuff {exprs: ~[ast::expr], tys: ~[ast::Ty]}
170170

171-
fn steal(crate: ast::crate, tm: test_mode) -> stolen_stuff {
171+
fn steal(crate: ast::crate, tm: test_mode) -> StolenStuff {
172172
let exprs = @mut ~[];
173173
let tys = @mut ~[];
174174
let v = visit::mk_simple_visitor(@visit::SimpleVisitor {
@@ -177,7 +177,7 @@ fn steal(crate: ast::crate, tm: test_mode) -> stolen_stuff {
177177
.. *visit::default_simple_visitor()
178178
});
179179
visit::visit_crate(crate, (), v);
180-
{exprs: *exprs, tys: *tys}
180+
StolenStuff {exprs: *exprs, tys: *tys}
181181
}
182182

183183

@@ -264,7 +264,7 @@ fn as_str(f: fn@(+x: io::Writer)) -> ~str {
264264
}
265265

266266
fn check_variants_of_ast(crate: ast::crate, codemap: @codemap::CodeMap,
267-
filename: &Path, cx: context) {
267+
filename: &Path, cx: Context) {
268268
let stolen = steal(crate, cx.mode);
269269
let extra_exprs = do common_exprs().filtered |a| {
270270
safe_to_use_expr(*a, cx.mode)
@@ -284,7 +284,7 @@ fn check_variants_T<T: Copy>(
284284
things: ~[T],
285285
stringifier: fn@(@T, @syntax::parse::token::ident_interner) -> ~str,
286286
replacer: fn@(ast::crate, uint, T, test_mode) -> ast::crate,
287-
cx: context
287+
cx: Context
288288
) {
289289
error!("%s contains %u %s objects", filename.to_str(),
290290
things.len(), thing_label);
@@ -594,7 +594,7 @@ fn check_convergence(files: &[Path]) {
594594
}
595595
}
596596

597-
fn check_variants(files: &[Path], cx: context) {
597+
fn check_variants(files: &[Path], cx: Context) {
598598
for files.each |file| {
599599
if cx.mode == tm_converge &&
600600
file_might_not_converge(file) {
@@ -652,9 +652,9 @@ fn main() {
652652
error!("== check_convergence ==");
653653
check_convergence(files);
654654
error!("== check_variants: converge ==");
655-
check_variants(files, { mode: tm_converge });
655+
check_variants(files, Context { mode: tm_converge });
656656
error!("== check_variants: run ==");
657-
check_variants(files, { mode: tm_run });
657+
check_variants(files, Context { mode: tm_run });
658658

659659
error!("Fuzzer done");
660660
}

0 commit comments

Comments
 (0)