From bf0ea66dac09cfc46973005cd940da0d5ebb8157 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Tue, 21 Aug 2012 18:32:23 -0700 Subject: libcore: update bytes/str reader to work with regions. This optimizes away a copy. --- src/fuzzer/fuzzer.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/fuzzer') diff --git a/src/fuzzer/fuzzer.rs b/src/fuzzer/fuzzer.rs index d9e6c0042d4..5d04ab8bf1a 100644 --- a/src/fuzzer/fuzzer.rs +++ b/src/fuzzer/fuzzer.rs @@ -259,16 +259,17 @@ fn check_variants_T( // It would be best to test the *crate* for stability, but // testing the string for stability is easier and ok for now. let handler = diagnostic::mk_handler(none); - let str3 = + let str3 = do io::with_str_reader("") |rdr| { @as_str(|a|pprust::print_crate( codemap, intr, diagnostic::mk_span_handler(handler, codemap), crate2, filename, - io::str_reader(~""), a, + rdr, a, pprust::no_ann(), - false)); + false)) + }; match cx.mode { tm_converge => { check_roundtrip_convergence(str3, 1u); @@ -419,7 +420,7 @@ fn parse_and_print(code: @~str) -> ~str { write_file(filename, *code); let crate = parse::parse_crate_from_source_str( filename, code, ~[], sess); - io::with_str_reader(*code, |rdr| { + do io::with_str_reader(*code) |rdr| { as_str(|a| pprust::print_crate( sess.cm, @@ -431,7 +432,7 @@ fn parse_and_print(code: @~str) -> ~str { rdr, a, pprust::no_ann(), false) ) - }) + } } fn has_raw_pointers(c: ast::crate) -> bool { -- cgit 1.4.1-3-g733a5