Skip to content

Commit 430ee0a

Browse files
author
Jonathan Turner
committed
Plumb through check_old_skool for expected/found
1 parent 3157691 commit 430ee0a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/librustc/infer/error_reporting.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ use std::cell::{Cell, RefCell};
9090
use std::char::from_u32;
9191
use std::fmt;
9292
use syntax::ast;
93-
use syntax::errors::DiagnosticBuilder;
93+
use syntax::errors::{DiagnosticBuilder, check_old_skool};
9494
use syntax::codemap::{self, Pos, Span};
9595
use syntax::parse::token;
9696
use syntax::ptr::P;
@@ -554,7 +554,7 @@ impl<'a, 'tcx> ErrorReporting<'tcx> for InferCtxt<'a, 'tcx> {
554554
"{}",
555555
trace.origin);
556556

557-
if !is_simple_error {
557+
if !is_simple_error || check_old_skool() {
558558
err = err.note_expected_found(&"type", &expected, &found);
559559
}
560560

src/libsyntax/errors/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,13 +691,13 @@ pub fn expect<T, M>(diag: &Handler, opt: Option<T>, msg: M) -> T where
691691
///
692692
/// FIXME(#33240)
693693
#[cfg(not(test))]
694-
fn check_old_skool() -> bool {
694+
pub fn check_old_skool() -> bool {
695695
use std::env;
696696
env::var("RUST_NEW_ERROR_FORMAT").is_err()
697697
}
698698

699699
/// For unit tests, use the new format.
700700
#[cfg(test)]
701-
fn check_old_skool() -> bool {
701+
pub fn check_old_skool() -> bool {
702702
false
703703
}

0 commit comments

Comments
 (0)