From c37282086b03eb92a6418662898f8422a88d3fa8 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 3 May 2016 09:02:28 +0200 Subject: [PATCH] infer: remove distinction for "simple type errors" Previously, the second "expected X, found Y" in parens was omitted for simple errors because it added no information. Now that this is always omitted, there is no need for a distinction anymore. This change restores the "expected, found" message for such errors. Fixes: #33366 --- src/librustc/infer/error_reporting.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/librustc/infer/error_reporting.rs b/src/librustc/infer/error_reporting.rs index 11d92f8585489..36dfb4bc4d2f6 100644 --- a/src/librustc/infer/error_reporting.rs +++ b/src/librustc/infer/error_reporting.rs @@ -542,21 +542,13 @@ impl<'a, 'tcx> ErrorReporting<'tcx> for InferCtxt<'a, 'tcx> { } }; - let is_simple_error = if let &TypeError::Sorts(ref values) = terr { - values.expected.is_primitive() && values.found.is_primitive() - } else { - false - }; - let mut err = struct_span_err!(self.tcx.sess, trace.origin.span(), E0308, "{}", trace.origin); - if !is_simple_error { - err = err.note_expected_found(&"type", &expected, &found); - } + err = err.note_expected_found(&"type", &expected, &found); err = err.span_label(trace.origin.span(), &terr);