summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-02-28 12:33:49 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-02-28 21:17:08 -0800
commit0e1a860789896fd2e6331648f1268c5b2cdb3573 (patch)
tree77ab66abdf87824620e9399cfab83c0b5ae38be3 /src/libsyntax/parse
parent324547140e0b67b109b43dfa79cc39cdf06151e5 (diff)
downloadrust-0e1a860789896fd2e6331648f1268c5b2cdb3573.tar.gz
rust-0e1a860789896fd2e6331648f1268c5b2cdb3573.zip
rustdoc: Capture all output from rustc by default
This helps prevent interleaving of error messages when running rustdoc tests.
This has an interesting bit of shuffling with I/O handles, but other than that
this is just using the APIs laid out in the previous commit.

Closes #12623
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/lexer.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs
index 5bace75a5ea..344aab63d5b 100644
--- a/src/libsyntax/parse/lexer.rs
+++ b/src/libsyntax/parse/lexer.rs
@@ -1004,6 +1004,7 @@ mod test {
     use diagnostic;
     use parse::token;
     use parse::token::{str_to_ident};
+    use std::io::util;
 
     // represents a testing reader (incl. both reader and interner)
     struct Env {
@@ -1014,7 +1015,10 @@ mod test {
     fn setup(teststr: ~str) -> Env {
         let cm = CodeMap::new();
         let fm = cm.new_filemap(~"zebra.rs", teststr);
-        let span_handler = diagnostic::mk_span_handler(diagnostic::mk_handler(), @cm);
+        let writer = ~util::NullWriter;
+        let emitter = diagnostic::EmitterWriter::new(writer);
+        let handler = diagnostic::mk_handler(~emitter);
+        let span_handler = diagnostic::mk_span_handler(handler, @cm);
         Env {
             string_reader: new_string_reader(span_handler,fm)
         }