about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAriel Ben-Yehuda <ariel.byd@gmail.com>2015-05-06 22:24:13 +0300
committerAriel Ben-Yehuda <ariel.byd@gmail.com>2015-05-06 22:24:13 +0300
commitdf42976e4db6565e8693460c34387e515d10ecfd (patch)
tree86ac77c9df7061336fb158387962d347ebef68de
parent4d8d68f80d2fb474188c1c2ee26d6266b4eaa003 (diff)
downloadrust-df42976e4db6565e8693460c34387e515d10ecfd.tar.gz
rust-df42976e4db6565e8693460c34387e515d10ecfd.zip
improve comment
-rw-r--r--src/librustc/middle/traits/error_reporting.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/librustc/middle/traits/error_reporting.rs b/src/librustc/middle/traits/error_reporting.rs
index 7d69df73cd2..ea29c48983f 100644
--- a/src/librustc/middle/traits/error_reporting.rs
+++ b/src/librustc/middle/traits/error_reporting.rs
@@ -57,8 +57,10 @@ pub fn report_projection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
     let predicate =
         infcx.resolve_type_vars_if_possible(&obligation.predicate);
     // The ty_err created by normalize_to_error can end up being unified
-    // into all obligations - we still have to report an error in that
-    // case.
+    // into all obligations: for example, if our obligation is something
+    // like `$X = <() as Foo<$X>>::Out` and () does not implement Foo<_>,
+    // then $X will be unified with ty_err, but the error still needs to be
+    // reported.
     if !infcx.tcx.sess.has_errors() || !predicate.references_error() {
         span_err!(infcx.tcx.sess, obligation.cause.span, E0271,
                 "type mismatch resolving `{}`: {}",