traits/error_reporting.rs: always note obligation cause

This commit is contained in:
Niko Matsakis 2015-08-11 14:32:01 -04:00
parent 157422a0c7
commit c106dd449c

View File

@ -206,13 +206,10 @@ pub fn report_selection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
// error message, report with that message if it does
let custom_note = report_on_unimplemented(infcx, &trait_ref.0,
obligation.cause.span);
if is_warning {
note_obligation_cause(infcx, obligation);
} else if let Some(s) = custom_note {
if let Some(s) = custom_note {
infcx.tcx.sess.span_note(obligation.cause.span, &s);
} else {
note_obligation_cause(infcx, obligation);
}
note_obligation_cause(infcx, obligation);
}
}