Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/librustc/infer/error_reporting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I'm surprised we're not seeing the span_label actually, even in old mode output.


Expand Down