Skip to content

Commit aa33b35

Browse files
committed
---
yaml --- r: 20742 b: refs/heads/snap-stage3 c: 19922fc h: refs/heads/master v: v3
1 parent c2b92f1 commit aa33b35

File tree

4 files changed

+34
-20
lines changed

4 files changed

+34
-20
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 4e9c475527b0a4cbf43b14c028370b0f784fd99f
4+
refs/heads/snap-stage3: 19922fcd93bfeac123719e319b7166f50660f847
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/fuzzer/fuzzer.rs

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,9 @@ fn check_variants_T<T: copy>(
263263
let str3 =
264264
@as_str(|a|pprust::print_crate(
265265
codemap,
266+
// Assuming we're not generating any token_trees
267+
@syntax::util::interner::mk::<@~str>(
268+
|x| str::hash(*x), |x,y| str::eq(*x,*y)),
266269
diagnostic::mk_span_handler(handler, codemap),
267270
crate2,
268271
filename,
@@ -420,13 +423,18 @@ fn parse_and_print(code: @~str) -> ~str {
420423
let crate = parse::parse_crate_from_source_str(
421424
filename, code, ~[], sess);
422425
io::with_str_reader(*code, |rdr| {
423-
as_str(|a| pprust::print_crate(sess.cm,
424-
sess.span_diagnostic,
425-
crate,
426-
filename,
427-
rdr, a,
428-
pprust::no_ann(),
429-
false) )
426+
as_str(|a|
427+
pprust::print_crate(
428+
sess.cm,
429+
// Assuming there are no token_trees
430+
@syntax::util::interner::mk::<@~str>(
431+
|x| str::hash(*x), |x,y| str::eq(*x,*y)),
432+
sess.span_diagnostic,
433+
crate,
434+
filename,
435+
rdr, a,
436+
pprust::no_ann(),
437+
false) )
430438
})
431439
}
432440

@@ -565,13 +573,17 @@ fn check_variants(files: ~[~str], cx: context) {
565573
s, ~[], sess);
566574
io::with_str_reader(*s, |rdr| {
567575
#error("%s",
568-
as_str(|a| pprust::print_crate(sess.cm,
569-
sess.span_diagnostic,
570-
crate,
571-
file,
572-
rdr, a,
573-
pprust::no_ann(),
574-
false) ))
576+
as_str(|a| pprust::print_crate(
577+
sess.cm,
578+
// Assuming no token_trees
579+
@syntax::util::interner::mk::<@~str>(
580+
|x| str::hash(*x), |x,y| str::eq(*x,*y)),
581+
sess.span_diagnostic,
582+
crate,
583+
file,
584+
rdr, a,
585+
pprust::no_ann(),
586+
false) ))
575587
});
576588
check_variants_of_ast(*crate, sess.cm, file, cx);
577589
}

branches/snap-stage3/src/libsyntax/print/pprust.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn no_ann() -> pp_ann {
2828
type ps =
2929
@{s: pp::printer,
3030
cm: option<codemap>,
31-
//in: interner::interner<@~str>,
31+
intr: @interner::interner<@~str>,
3232
comments: option<~[comments::cmnt]>,
3333
literals: option<~[comments::lit]>,
3434
mut cur_cmnt: uint,
@@ -49,7 +49,8 @@ fn end(s: ps) {
4949
fn rust_printer(writer: io::writer) -> ps {
5050
ret @{s: pp::mk_printer(writer, default_columns),
5151
cm: none::<codemap>,
52-
//in: interner::mk::<@~str>(|x| str::hash(*x), |x,y| str::eq(*x, *y)),
52+
intr: @interner::mk::<@~str>(|x| str::hash(*x),
53+
|x,y| str::eq(*x, *y)),
5354
comments: none::<~[comments::cmnt]>,
5455
literals: none::<~[comments::lit]>,
5556
mut cur_cmnt: 0u,
@@ -66,7 +67,7 @@ const default_columns: uint = 78u;
6667
// Requires you to pass an input filename and reader so that
6768
// it can scan the input text for comments and literals to
6869
// copy forward.
69-
fn print_crate(cm: codemap, //in: interner::interner<@~str>,
70+
fn print_crate(cm: codemap, intr: @interner::interner<@~str>,
7071
span_diagnostic: diagnostic::span_handler,
7172
crate: @ast::crate, filename: ~str, in: io::reader,
7273
out: io::writer, ann: pp_ann, is_expanded: bool) {
@@ -75,7 +76,7 @@ fn print_crate(cm: codemap, //in: interner::interner<@~str>,
7576
let s =
7677
@{s: pp::mk_printer(out, default_columns),
7778
cm: some(cm),
78-
//in: in,
79+
intr: intr,
7980
comments: some(r.cmnts),
8081
// If the code is post expansion, don't use the table of
8182
// literals, since it doesn't correspond with the literals

branches/snap-stage3/src/rustc/driver/driver.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ fn pretty_print_input(sess: session, cfg: ast::crate_cfg, input: input,
327327
let is_expanded = upto != cu_parse;
328328
let src = codemap::get_filemap(sess.codemap, source_name(input)).src;
329329
do io::with_str_reader(*src) |rdr| {
330-
pprust::print_crate(sess.codemap, sess.span_diagnostic, crate,
330+
pprust::print_crate(sess.codemap, sess.parse_sess.interner,
331+
sess.span_diagnostic, crate,
331332
source_name(input),
332333
rdr, io::stdout(), ann, is_expanded);
333334
}

0 commit comments

Comments
 (0)