]> git.lizzy.rs Git - rust.git/commitdiff
traits/error_reporting.rs: always note obligation cause
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 11 Aug 2015 18:32:01 +0000 (14:32 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 12 Aug 2015 21:58:58 +0000 (17:58 -0400)
src/librustc/middle/traits/error_reporting.rs

index fb2db5089c9784645002c7b3bd14e964ea2b9f9a..467c752499b36ed6b6d15004ccfda8b4b5e7ae95 100644 (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);
                         }
                     }