Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fad4f32

Browse files
author
Jonathan Turner
committedAug 7, 2016
Turn on new errors, json mode. Remove duplicate unicode test
1 parent 42903d9 commit fad4f32

File tree

18 files changed

+29
-595
lines changed

18 files changed

+29
-595
lines changed
 

‎src/librustc/infer/error_reporting.rs‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ use syntax::ast;
9494
use syntax::parse::token;
9595
use syntax::ptr::P;
9696
use syntax_pos::{self, Pos, Span};
97-
use errors::{DiagnosticBuilder, check_old_school};
97+
use errors::DiagnosticBuilder;
9898

9999
impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
100100
pub fn note_and_explain_region(self,
@@ -541,25 +541,19 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
541541

542542
let span = origin.span();
543543

544-
let mut is_simple_error = false;
545-
546544
if let Some((expected, found)) = expected_found {
547-
is_simple_error = if let &TypeError::Sorts(ref values) = terr {
545+
let is_simple_error = if let &TypeError::Sorts(ref values) = terr {
548546
values.expected.is_primitive() && values.found.is_primitive()
549547
} else {
550548
false
551549
};
552550

553-
if !is_simple_error || check_old_school() {
551+
if !is_simple_error {
554552
diag.note_expected_found(&"type", &expected, &found);
555553
}
556554
}
557555

558-
if !is_simple_error && check_old_school() {
559-
diag.span_note(span, &format!("{}", terr));
560-
} else {
561-
diag.span_label(span, &terr);
562-
}
556+
diag.span_label(span, &terr);
563557

564558
self.note_error_origin(diag, &origin);
565559
self.check_and_note_conflicting_crates(diag, terr, span);

‎src/librustc/session/config.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
10551055
"NAME=PATH"),
10561056
opt::opt_s("", "sysroot", "Override the system root", "PATH"),
10571057
opt::multi_ubnr("Z", "", "Set internal debugging options", "FLAG"),
1058-
opt::opt_ubnr("", "error-format",
1058+
opt::opt_s("", "error-format",
10591059
"How errors and other messages are produced",
10601060
"human|json"),
10611061
opt::opt_s("", "color", "Configure coloring of output:

‎src/librustc/session/mod.rs‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use mir::transform as mir_pass;
2323
use syntax::ast::{NodeId, Name};
2424
use errors::{self, DiagnosticBuilder};
2525
use errors::emitter::{Emitter, EmitterWriter};
26-
use errors::snippet::FormatMode;
2726
use syntax::json::JsonEmitter;
2827
use syntax::feature_gate;
2928
use syntax::parse;
@@ -369,9 +368,7 @@ pub fn build_session_with_codemap(sopts: config::Options,
369368
let emitter: Box<Emitter> = match sopts.error_format {
370369
config::ErrorOutputType::HumanReadable(color_config) => {
371370
Box::new(EmitterWriter::stderr(color_config,
372-
Some(registry),
373-
Some(codemap.clone()),
374-
errors::snippet::FormatMode::EnvironmentSelected))
371+
Some(codemap.clone())))
375372
}
376373
config::ErrorOutputType::Json => {
377374
Box::new(JsonEmitter::stderr(Some(registry), codemap.clone()))
@@ -509,9 +506,7 @@ pub fn early_error(output: config::ErrorOutputType, msg: &str) -> ! {
509506
let emitter: Box<Emitter> = match output {
510507
config::ErrorOutputType::HumanReadable(color_config) => {
511508
Box::new(EmitterWriter::stderr(color_config,
512-
None,
513-
None,
514-
FormatMode::EnvironmentSelected))
509+
None))
515510
}
516511
config::ErrorOutputType::Json => Box::new(JsonEmitter::basic()),
517512
};
@@ -524,9 +519,7 @@ pub fn early_warn(output: config::ErrorOutputType, msg: &str) {
524519
let emitter: Box<Emitter> = match output {
525520
config::ErrorOutputType::HumanReadable(color_config) => {
526521
Box::new(EmitterWriter::stderr(color_config,
527-
None,
528-
None,
529-
FormatMode::EnvironmentSelected))
522+
None))
530523
}
531524
config::ErrorOutputType::Json => Box::new(JsonEmitter::basic()),
532525
};

‎src/librustc_const_eval/eval.rs‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use std::cmp::Ordering;
4444
use std::collections::hash_map::Entry::Vacant;
4545

4646
use rustc_const_math::*;
47-
use rustc_errors::{DiagnosticBuilder, check_old_school};
47+
use rustc_errors::DiagnosticBuilder;
4848

4949
macro_rules! math {
5050
($e:expr, $op:expr) => {
@@ -378,11 +378,7 @@ pub fn note_const_eval_err<'a, 'tcx>(
378378
{
379379
match err.description() {
380380
ConstEvalErrDescription::Simple(message) => {
381-
if check_old_school() {
382-
diag.note(&message);
383-
} else {
384-
diag.span_label(err.span, &message);
385-
}
381+
diag.span_label(err.span, &message);
386382
}
387383
}
388384

‎src/librustc_driver/lib.rs‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ use syntax::feature_gate::{GatedCfg, UnstableFeatures};
100100
use syntax::parse::{self, PResult};
101101
use syntax_pos::MultiSpan;
102102
use errors::emitter::Emitter;
103-
use errors::snippet::FormatMode;
104103

105104
#[cfg(test)]
106105
pub mod test;
@@ -141,9 +140,7 @@ pub fn run(args: Vec<String>) -> isize {
141140
None => {
142141
let emitter =
143142
errors::emitter::EmitterWriter::stderr(errors::ColorConfig::Auto,
144-
None,
145-
None,
146-
FormatMode::EnvironmentSelected);
143+
None);
147144
let handler = errors::Handler::with_emitter(true, false, Box::new(emitter));
148145
handler.emit(&MultiSpan::new(),
149146
&abort_msg(err_count),
@@ -381,10 +378,7 @@ fn check_cfg(sopts: &config::Options,
381378
output: ErrorOutputType) {
382379
let emitter: Box<Emitter> = match output {
383380
config::ErrorOutputType::HumanReadable(color_config) => {
384-
Box::new(errors::emitter::EmitterWriter::stderr(color_config,
385-
None,
386-
None,
387-
FormatMode::EnvironmentSelected))
381+
Box::new(errors::emitter::EmitterWriter::stderr(color_config, None))
388382
}
389383
config::ErrorOutputType::Json => Box::new(json::JsonEmitter::basic()),
390384
};
@@ -1050,10 +1044,7 @@ pub fn monitor<F: FnOnce() + Send + 'static>(f: F) {
10501044
// Thread panicked without emitting a fatal diagnostic
10511045
if !value.is::<errors::FatalError>() {
10521046
let emitter =
1053-
Box::new(errors::emitter::EmitterWriter::stderr(errors::ColorConfig::Auto,
1054-
None,
1055-
None,
1056-
FormatMode::EnvironmentSelected));
1047+
Box::new(errors::emitter::EmitterWriter::stderr(errors::ColorConfig::Auto, None));
10571048
let handler = errors::Handler::with_emitter(true, false, emitter);
10581049

10591050
// a .span_bug or .bug call has already printed what

‎src/librustc_errors/emitter.rs‎

Lines changed: 8 additions & 280 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@
1010

1111
use self::Destination::*;
1212

13-
use syntax_pos::{COMMAND_LINE_SP, DUMMY_SP, FileMap, Span, MultiSpan, LineInfo, CharPos};
14-
use registry;
13+
use syntax_pos::{COMMAND_LINE_SP, DUMMY_SP, FileMap, Span, MultiSpan, CharPos};
1514

16-
use check_old_school;
1715
use {Level, CodeSuggestion, DiagnosticBuilder, CodeMapper};
1816
use RenderSpan::*;
19-
use snippet::{StyledString, Style, FormatMode, Annotation, Line};
17+
use snippet::{StyledString, Style, Annotation, Line};
2018
use styled_buffer::StyledBuffer;
2119

22-
use std::cmp;
2320
use std::io::prelude::*;
2421
use std::io;
2522
use std::rc::Rc;
@@ -33,18 +30,7 @@ pub trait Emitter {
3330

3431
impl Emitter for EmitterWriter {
3532
fn emit(&mut self, db: &DiagnosticBuilder) {
36-
// Pick old school mode either from env or let the test dictate the format
37-
let old_school = match self.format_mode {
38-
FormatMode::NewErrorFormat => false,
39-
FormatMode::OriginalErrorFormat => true,
40-
FormatMode::EnvironmentSelected => check_old_school()
41-
};
42-
43-
if old_school {
44-
self.emit_messages_old_school(db);
45-
} else {
46-
self.emit_messages_default(db);
47-
}
33+
self.emit_messages_default(db);
4834
}
4935
}
5036

@@ -70,11 +56,7 @@ impl ColorConfig {
7056

7157
pub struct EmitterWriter {
7258
dst: Destination,
73-
registry: Option<registry::Registry>,
7459
cm: Option<Rc<CodeMapper>>,
75-
76-
// For now, allow an old-school mode while we transition
77-
format_mode: FormatMode
7860
}
7961

8062
struct FileWithAnnotatedLines {
@@ -99,33 +81,23 @@ macro_rules! println_maybe_styled {
9981

10082
impl EmitterWriter {
10183
pub fn stderr(color_config: ColorConfig,
102-
registry: Option<registry::Registry>,
103-
code_map: Option<Rc<CodeMapper>>,
104-
format_mode: FormatMode)
84+
code_map: Option<Rc<CodeMapper>>)
10585
-> EmitterWriter {
10686
if color_config.use_color() {
10787
let dst = Destination::from_stderr();
10888
EmitterWriter { dst: dst,
109-
registry: registry,
110-
cm: code_map,
111-
format_mode: format_mode.clone() }
89+
cm: code_map}
11290
} else {
11391
EmitterWriter { dst: Raw(Box::new(io::stderr())),
114-
registry: registry,
115-
cm: code_map,
116-
format_mode: format_mode.clone() }
92+
cm: code_map}
11793
}
11894
}
11995

12096
pub fn new(dst: Box<Write + Send>,
121-
registry: Option<registry::Registry>,
122-
code_map: Option<Rc<CodeMapper>>,
123-
format_mode: FormatMode)
97+
code_map: Option<Rc<CodeMapper>>)
12498
-> EmitterWriter {
12599
EmitterWriter { dst: Raw(dst),
126-
registry: registry,
127-
cm: code_map,
128-
format_mode: format_mode.clone() }
100+
cm: code_map}
129101
}
130102

131103
fn preprocess_annotations(&self, msp: &MultiSpan) -> Vec<FileWithAnnotatedLines> {
@@ -668,240 +640,6 @@ impl EmitterWriter {
668640
_ => ()
669641
}
670642
}
671-
fn emit_message_old_school(&mut self,
672-
msp: &MultiSpan,
673-
msg: &str,
674-
code: &Option<String>,
675-
level: &Level,
676-
show_snippet: bool)
677-
-> io::Result<()> {
678-
let mut buffer = StyledBuffer::new();
679-
680-
let loc = match msp.primary_span() {
681-
Some(COMMAND_LINE_SP) | Some(DUMMY_SP) => "".to_string(),
682-
Some(ps) => if let Some(ref cm) = self.cm {
683-
cm.span_to_string(ps)
684-
} else {
685-
"".to_string()
686-
},
687-
None => {
688-
"".to_string()
689-
}
690-
};
691-
if loc != "" {
692-
buffer.append(0, &loc, Style::NoStyle);
693-
buffer.append(0, " ", Style::NoStyle);
694-
}
695-
buffer.append(0, &level.to_string(), Style::Level(level.clone()));
696-
buffer.append(0, ": ", Style::HeaderMsg);
697-
buffer.append(0, msg, Style::HeaderMsg);
698-
buffer.append(0, " ", Style::NoStyle);
699-
match code {
700-
&Some(ref code) => {
701-
buffer.append(0, "[", Style::ErrorCode);
702-
buffer.append(0, &code, Style::ErrorCode);
703-
buffer.append(0, "]", Style::ErrorCode);
704-
}
705-
_ => {}
706-
}
707-
708-
if !show_snippet {
709-
emit_to_destination(&buffer.render(), level, &mut self.dst)?;
710-
return Ok(());
711-
}
712-
713-
// Watch out for various nasty special spans; don't try to
714-
// print any filename or anything for those.
715-
match msp.primary_span() {
716-
Some(COMMAND_LINE_SP) | Some(DUMMY_SP) => {
717-
emit_to_destination(&buffer.render(), level, &mut self.dst)?;
718-
return Ok(());
719-
}
720-
_ => { }
721-
}
722-
723-
let annotated_files = self.preprocess_annotations(msp);
724-
725-
if let (Some(ref cm), Some(ann_file), Some(ref primary_span)) =
726-
(self.cm.as_ref(), annotated_files.first(), msp.primary_span().as_ref()) {
727-
728-
// Next, print the source line and its squiggle
729-
// for old school mode, we will render them to the buffer, then insert the file loc
730-
// (or space the same amount) in front of the line and the squiggle
731-
let source_string = ann_file.file.get_line(ann_file.lines[0].line_index - 1)
732-
.unwrap_or("");
733-
734-
let line_offset = buffer.num_lines();
735-
736-
let lo = cm.lookup_char_pos(primary_span.lo);
737-
//Before each secondary line in old skool-mode, print the label
738-
//as an old-style note
739-
let file_pos = format!("{}:{} ", lo.file.name.clone(), lo.line);
740-
let file_pos_len = file_pos.len();
741-
742-
// First create the source line we will highlight.
743-
buffer.puts(line_offset, 0, &file_pos, Style::FileNameStyle);
744-
buffer.puts(line_offset, file_pos_len, &source_string, Style::Quotation);
745-
// Sort the annotations by (start, end col)
746-
let annotations = ann_file.lines[0].annotations.clone();
747-
748-
// Next, create the highlight line.
749-
for annotation in &annotations {
750-
for p in annotation.start_col..annotation.end_col {
751-
if p == annotation.start_col {
752-
buffer.putc(line_offset + 1,
753-
file_pos_len + p,
754-
'^',
755-
if annotation.is_primary {
756-
Style::UnderlinePrimary
757-
} else {
758-
Style::OldSchoolNote
759-
});
760-
} else {
761-
buffer.putc(line_offset + 1,
762-
file_pos_len + p,
763-
'~',
764-
if annotation.is_primary {
765-
Style::UnderlinePrimary
766-
} else {
767-
Style::OldSchoolNote
768-
});
769-
}
770-
}
771-
}
772-
}
773-
if let Some(ref primary_span) = msp.primary_span().as_ref() {
774-
self.render_macro_backtrace_old_school(primary_span, &mut buffer)?;
775-
}
776-
777-
match code {
778-
&Some(ref code) if self.registry.as_ref()
779-
.and_then(|registry| registry.find_description(code))
780-
.is_some() => {
781-
let msg = "run `rustc --explain ".to_string() + &code.to_string() +
782-
"` to see a detailed explanation";
783-
784-
let line_offset = buffer.num_lines();
785-
buffer.append(line_offset, &loc, Style::NoStyle);
786-
buffer.append(line_offset, " ", Style::NoStyle);
787-
buffer.append(line_offset, &Level::Help.to_string(), Style::Level(Level::Help));
788-
buffer.append(line_offset, ": ", Style::HeaderMsg);
789-
buffer.append(line_offset, &msg, Style::HeaderMsg);
790-
}
791-
_ => ()
792-
}
793-
794-
// final step: take our styled buffer, render it, then output it
795-
emit_to_destination(&buffer.render(), level, &mut self.dst)?;
796-
Ok(())
797-
}
798-
fn emit_suggestion_old_school(&mut self,
799-
suggestion: &CodeSuggestion,
800-
level: &Level,
801-
msg: &str)
802-
-> io::Result<()> {
803-
use std::borrow::Borrow;
804-
805-
let primary_span = suggestion.msp.primary_span().unwrap();
806-
if let Some(ref cm) = self.cm {
807-
let mut buffer = StyledBuffer::new();
808-
809-
let loc = cm.span_to_string(primary_span);
810-
811-
if loc != "" {
812-
buffer.append(0, &loc, Style::NoStyle);
813-
buffer.append(0, " ", Style::NoStyle);
814-
}
815-
816-
buffer.append(0, &level.to_string(), Style::Level(level.clone()));
817-
buffer.append(0, ": ", Style::HeaderMsg);
818-
buffer.append(0, msg, Style::HeaderMsg);
819-
820-
let lines = cm.span_to_lines(primary_span).unwrap();
821-
822-
assert!(!lines.lines.is_empty());
823-
824-
let complete = suggestion.splice_lines(cm.borrow());
825-
let line_count = cmp::min(lines.lines.len(), MAX_HIGHLIGHT_LINES);
826-
let display_lines = &lines.lines[..line_count];
827-
828-
let fm = &*lines.file;
829-
// Calculate the widest number to format evenly
830-
let max_digits = line_num_max_digits(display_lines.last().unwrap());
831-
832-
// print the suggestion without any line numbers, but leave
833-
// space for them. This helps with lining up with previous
834-
// snippets from the actual error being reported.
835-
let mut lines = complete.lines();
836-
let mut row_num = 1;
837-
for line in lines.by_ref().take(MAX_HIGHLIGHT_LINES) {
838-
buffer.append(row_num, &fm.name, Style::FileNameStyle);
839-
for _ in 0..max_digits+2 {
840-
buffer.append(row_num, &" ", Style::NoStyle);
841-
}
842-
buffer.append(row_num, line, Style::NoStyle);
843-
row_num += 1;
844-
}
845-
846-
// if we elided some lines, add an ellipsis
847-
if let Some(_) = lines.next() {
848-
buffer.append(row_num, "...", Style::NoStyle);
849-
}
850-
emit_to_destination(&buffer.render(), level, &mut self.dst)?;
851-
}
852-
Ok(())
853-
}
854-
855-
fn emit_messages_old_school(&mut self, db: &DiagnosticBuilder) {
856-
match self.emit_message_old_school(&db.span,
857-
&db.message,
858-
&db.code,
859-
&db.level,
860-
true) {
861-
Ok(()) => {
862-
for child in &db.children {
863-
let (span, show_snippet) = if child.span.primary_spans().is_empty() {
864-
(db.span.clone(), false)
865-
} else {
866-
(child.span.clone(), true)
867-
};
868-
869-
match child.render_span {
870-
Some(FullSpan(_)) => {
871-
match self.emit_message_old_school(&span,
872-
&child.message,
873-
&None,
874-
&child.level,
875-
show_snippet) {
876-
Err(e) => panic!("failed to emit error: {}", e),
877-
_ => ()
878-
}
879-
},
880-
Some(Suggestion(ref cs)) => {
881-
match self.emit_suggestion_old_school(cs,
882-
&child.level,
883-
&child.message) {
884-
Err(e) => panic!("failed to emit error: {}", e),
885-
_ => ()
886-
}
887-
},
888-
None => {
889-
match self.emit_message_old_school(&span,
890-
&child.message,
891-
&None,
892-
&child.level,
893-
show_snippet) {
894-
Err(e) => panic!("failed to emit error: {}", e),
895-
_ => ()
896-
}
897-
}
898-
}
899-
}
900-
}
901-
Err(e) => panic!("failed to emit error: {}", e)
902-
}
903-
}
904-
905643
fn render_macro_backtrace_old_school(&mut self,
906644
sp: &Span,
907645
buffer: &mut StyledBuffer) -> io::Result<()> {
@@ -958,16 +696,6 @@ fn emit_to_destination(rendered_buffer: &Vec<Vec<StyledString>>,
958696
Ok(())
959697
}
960698

961-
fn line_num_max_digits(line: &LineInfo) -> usize {
962-
let mut max_line_num = line.line_index + 1;
963-
let mut digits = 0;
964-
while max_line_num > 0 {
965-
max_line_num /= 10;
966-
digits += 1;
967-
}
968-
digits
969-
}
970-
971699
#[cfg(unix)]
972700
fn stderr_isatty() -> bool {
973701
use libc;

‎src/librustc_errors/lib.rs‎

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -420,13 +420,11 @@ pub struct Handler {
420420

421421
impl Handler {
422422
pub fn with_tty_emitter(color_config: ColorConfig,
423-
registry: Option<registry::Registry>,
424423
can_emit_warnings: bool,
425424
treat_err_as_bug: bool,
426425
cm: Option<Rc<CodeMapper>>)
427426
-> Handler {
428-
let emitter = Box::new(EmitterWriter::stderr(color_config, registry, cm,
429-
snippet::FormatMode::EnvironmentSelected));
427+
let emitter = Box::new(EmitterWriter::stderr(color_config, cm));
430428
Handler::with_emitter(can_emit_warnings, treat_err_as_bug, emitter)
431429
}
432430

@@ -750,21 +748,4 @@ pub fn expect<T, M>(diag: &Handler, opt: Option<T>, msg: M) -> T where
750748
Some(t) => t,
751749
None => diag.bug(&msg()),
752750
}
753-
}
754-
755-
/// True if we should use the old-skool error format style. This is
756-
/// the default setting until the new errors are deemed stable enough
757-
/// for general use.
758-
///
759-
/// FIXME(#33240)
760-
#[cfg(not(test))]
761-
pub fn check_old_school() -> bool {
762-
use std::env;
763-
env::var("RUST_NEW_ERROR_FORMAT").is_err()
764-
}
765-
766-
/// For unit tests, use the new format.
767-
#[cfg(test)]
768-
pub fn check_old_school() -> bool {
769-
false
770-
}
751+
}

‎src/librustc_errors/snippet.rs‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,10 @@ use CodeMapper;
1515
use std::rc::Rc;
1616
use {Level};
1717

18-
#[derive(Clone)]
19-
pub enum FormatMode {
20-
NewErrorFormat,
21-
OriginalErrorFormat,
22-
EnvironmentSelected
23-
}
24-
2518
#[derive(Clone)]
2619
pub struct SnippetData {
2720
codemap: Rc<CodeMapper>,
28-
files: Vec<FileInfo>,
29-
format_mode: FormatMode,
21+
files: Vec<FileInfo>
3022
}
3123

3224
#[derive(Clone)]
@@ -41,10 +33,6 @@ pub struct FileInfo {
4133
primary_span: Option<Span>,
4234

4335
lines: Vec<Line>,
44-
45-
/// The type of error format to render. We keep it here so that
46-
/// it's easy to configure for both tests and regular usage
47-
format_mode: FormatMode,
4836
}
4937

5038
#[derive(Clone, Debug, PartialOrd, Ord, PartialEq, Eq)]

‎src/librustdoc/core.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ pub fn run_core(search_paths: SearchPaths,
128128

129129
let codemap = Rc::new(codemap::CodeMap::new());
130130
let diagnostic_handler = errors::Handler::with_tty_emitter(ColorConfig::Auto,
131-
None,
132131
true,
133132
false,
134133
Some(codemap.clone()));

‎src/librustdoc/test.rs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ pub fn run(input: &str,
7474

7575
let codemap = Rc::new(CodeMap::new());
7676
let diagnostic_handler = errors::Handler::with_tty_emitter(ColorConfig::Auto,
77-
None,
7877
true,
7978
false,
8079
Some(codemap.clone()));
@@ -228,9 +227,7 @@ fn runtest(test: &str, cratename: &str, cfgs: Vec<String>, libs: SearchPaths,
228227
let data = Arc::new(Mutex::new(Vec::new()));
229228
let codemap = Rc::new(CodeMap::new());
230229
let emitter = errors::emitter::EmitterWriter::new(box Sink(data.clone()),
231-
None,
232-
Some(codemap.clone()),
233-
errors::snippet::FormatMode::EnvironmentSelected);
230+
Some(codemap.clone()));
234231
let old = io::set_panic(box Sink(data.clone()));
235232
let _bomb = Bomb(data.clone(), old.unwrap_or(box io::stdout()));
236233

‎src/libsyntax/parse/mod.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ impl ParseSess {
5151
pub fn new() -> ParseSess {
5252
let cm = Rc::new(CodeMap::new());
5353
let handler = Handler::with_tty_emitter(ColorConfig::Auto,
54-
None,
5554
true,
5655
false,
5756
Some(cm.clone()));

‎src/test/run-make/error-found-staticlib-instead-crate/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
all:
44
$(RUSTC) foo.rs --crate-type staticlib
5-
$(RUSTC) bar.rs 2>&1 | grep "error: found staticlib"
5+
$(RUSTC) bar.rs 2>&1 | grep "found staticlib"

‎src/test/run-make/many-crates-but-no-match/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ all:
2727
mv $(TMPDIR)/$(call RLIB_GLOB,crateA) $(A3)
2828
# Ensure crateC fails to compile since A1 is "missing" and A2/A3 hashes do not match
2929
$(RUSTC) -L $(A2) -L $(A3) crateC.rs >$(LOG) 2>&1 || true
30-
grep "error: found possibly newer version of crate \`crateA\` which \`crateB\` depends on" $(LOG)
30+
grep "found possibly newer version of crate \`crateA\` which \`crateB\` depends on" $(LOG)
3131
grep "note: perhaps that crate needs to be recompiled?" $(LOG)
3232
grep "note: crate \`crateA\` path #1:" $(LOG)
3333
grep "note: crate \`crateA\` path #2:" $(LOG)

‎src/test/run-make/missing-crate-dependency/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ all:
66
$(call REMOVE_RLIBS,crateA)
77
# Ensure crateC fails to compile since dependency crateA is missing
88
$(RUSTC) crateC.rs 2>&1 | \
9-
grep "error: can't find crate for \`crateA\` which \`crateB\` depends on"
9+
grep "can't find crate for \`crateA\` which \`crateB\` depends on"

‎src/test/run-make/unicode-input/Makefile‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎src/test/run-make/unicode-input/multiple_files.rs‎

Lines changed: 0 additions & 74 deletions
This file was deleted.

‎src/test/run-make/unicode-input/span_length.rs‎

Lines changed: 0 additions & 130 deletions
This file was deleted.

‎src/tools/compiletest/src/runtest.rs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,9 +1330,7 @@ actual:\n\
13301330
// patterns still match the raw compiler output.
13311331
if self.props.error_patterns.is_empty() {
13321332
args.extend(["--error-format",
1333-
"json",
1334-
"-Z",
1335-
"unstable-options"]
1333+
"json"]
13361334
.iter()
13371335
.map(|s| s.to_string()));
13381336
}

0 commit comments

Comments
 (0)
Please sign in to comment.