@@ -345,13 +345,13 @@ pub fn check_variants_T<T:Copy>(crate: @ast::crate,
345
345
intr,
346
346
span_handler,
347
347
crate2,
348
- fname.to_str (),
348
+ fname.to_managed (),
349
349
rdr,
350
350
a,
351
351
pprust::no_ann(),
352
352
false)
353
353
};
354
- @ string
354
+ string.to_managed()
355
355
};
356
356
match cx.mode {
357
357
tm_converge => check_roundtrip_convergence(str3, 1),
@@ -361,9 +361,9 @@ pub fn check_variants_T<T:Copy>(crate: @ast::crate,
361
361
thing_label,
362
362
i,
363
363
j);
364
- let safe_to_run = !(content_is_dangerous_to_run(* str3)
364
+ let safe_to_run = !(content_is_dangerous_to_run(str3)
365
365
|| has_raw_pointers(crate2));
366
- check_whole_compiler(* str3,
366
+ check_whole_compiler(str3,
367
367
&Path(file_label),
368
368
safe_to_run);
369
369
}
@@ -502,28 +502,28 @@ pub fn check_compiling(filename: &Path) -> happiness {
502
502
}
503
503
504
504
505
- pub fn parse_and_print(code: @~ str) -> ~ str {
505
+ pub fn parse_and_print(code: @str) -> @ str {
506
506
let filename = Path("tmp.rs");
507
507
let sess = parse::new_parse_sess(option::None);
508
- write_file(&filename, * code);
509
- let crate = parse::parse_crate_from_source_str(filename.to_str(),
508
+ write_file(&filename, code);
509
+ let crate = parse::parse_crate_from_source_str(filename.to_str().to_managed() ,
510
510
code,
511
511
~[],
512
512
sess);
513
- do io::with_str_reader(* code) |rdr| {
513
+ do io::with_str_reader(code) |rdr| {
514
514
let filename = filename.to_str();
515
515
do as_str |a| {
516
516
pprust::print_crate(sess.cm,
517
517
// Assuming there are no token_trees
518
518
token::mk_fake_ident_interner(),
519
519
copy sess.span_diagnostic,
520
520
crate,
521
- filename.to_str (),
521
+ filename.to_managed (),
522
522
rdr,
523
523
a,
524
524
pprust::no_ann(),
525
525
false)
526
- }
526
+ }.to_managed()
527
527
}
528
528
}
529
529
@@ -598,15 +598,15 @@ pub fn file_might_not_converge(filename: &Path) -> bool {
598
598
return false;
599
599
}
600
600
601
- pub fn check_roundtrip_convergence(code: @~ str, maxIters: uint) {
601
+ pub fn check_roundtrip_convergence(code: @str, maxIters: uint) {
602
602
let mut i = 0u;
603
603
let mut newv = code;
604
604
let mut oldv = code;
605
605
606
606
while i < maxIters {
607
607
oldv = newv;
608
- if content_might_not_converge(* oldv) { return; }
609
- newv = @ parse_and_print(oldv);
608
+ if content_might_not_converge(oldv) { return; }
609
+ newv = parse_and_print(oldv);
610
610
if oldv == newv { break; }
611
611
i += 1u;
612
612
}
@@ -615,8 +615,8 @@ pub fn check_roundtrip_convergence(code: @~str, maxIters: uint) {
615
615
error!("Converged after %u iterations", i);
616
616
} else {
617
617
error!("Did not converge after %u iterations!", i);
618
- write_file(&Path("round-trip-a.rs"), * oldv);
619
- write_file(&Path("round-trip-b.rs"), * newv);
618
+ write_file(&Path("round-trip-a.rs"), oldv);
619
+ write_file(&Path("round-trip-b.rs"), newv);
620
620
run::process_status("diff", [~"-w", ~"-u", ~"round-trip-a.rs", ~"round-trip-b.rs"]);
621
621
fail!("Mismatch");
622
622
}
@@ -626,8 +626,8 @@ pub fn check_convergence(files: &[Path]) {
626
626
error!("pp convergence tests: %u files", files.len());
627
627
for files.each |file| {
628
628
if !file_might_not_converge(file) {
629
- let s = @ result::get(&io::read_whole_file_str(file));
630
- if !content_might_not_converge(* s) {
629
+ let s = result::get(&io::read_whole_file_str(file)).to_managed( );
630
+ if !content_might_not_converge(s) {
631
631
error!("pp converge: %s", file.to_str());
632
632
// Change from 7u to 2u once
633
633
// https://github.com/mozilla/rust/issues/850 is fixed
@@ -646,26 +646,26 @@ pub fn check_variants(files: &[Path], cx: Context) {
646
646
loop;
647
647
}
648
648
649
- let s = @ result::get(&io::read_whole_file_str(file));
650
- if contains(*s, "#" ) {
649
+ let s = result::get(&io::read_whole_file_str(file)).to_managed( );
650
+ if s.contains_char('#' ) {
651
651
loop; // Macros are confusing
652
652
}
653
- if cx.mode == tm_converge && content_might_not_converge(* s) {
653
+ if cx.mode == tm_converge && content_might_not_converge(s) {
654
654
loop;
655
655
}
656
- if cx.mode == tm_run && content_is_dangerous_to_compile(* s) {
656
+ if cx.mode == tm_run && content_is_dangerous_to_compile(s) {
657
657
loop;
658
658
}
659
659
660
660
let file_str = file.to_str();
661
661
662
662
error!("check_variants: %?", file_str);
663
663
let sess = parse::new_parse_sess(None);
664
- let crate = parse::parse_crate_from_source_str(file_str.to_str (),
664
+ let crate = parse::parse_crate_from_source_str(file_str.to_managed (),
665
665
s,
666
666
~[],
667
667
sess);
668
- io::with_str_reader(* s, |rdr| {
668
+ io::with_str_reader(s, |rdr| {
669
669
let file_str = file_str.to_str();
670
670
error!("%s",
671
671
as_str(|a| {
@@ -675,7 +675,7 @@ pub fn check_variants(files: &[Path], cx: Context) {
675
675
token::mk_fake_ident_interner(),
676
676
copy sess.span_diagnostic,
677
677
crate,
678
- file_str.to_str (),
678
+ file_str.to_managed (),
679
679
rdr,
680
680
a,
681
681
pprust::no_ann(),
0 commit comments