Skip to content

Commit df42976

Browse files
committed
improve comment
1 parent 4d8d68f commit df42976

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/librustc/middle/traits/error_reporting.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ pub fn report_projection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
5757
let predicate =
5858
infcx.resolve_type_vars_if_possible(&obligation.predicate);
5959
// The ty_err created by normalize_to_error can end up being unified
60-
// into all obligations - we still have to report an error in that
61-
// case.
60+
// into all obligations: for example, if our obligation is something
61+
// like `$X = <() as Foo<$X>>::Out` and () does not implement Foo<_>,
62+
// then $X will be unified with ty_err, but the error still needs to be
63+
// reported.
6264
if !infcx.tcx.sess.has_errors() || !predicate.references_error() {
6365
span_err!(infcx.tcx.sess, obligation.cause.span, E0271,
6466
"type mismatch resolving `{}`: {}",

0 commit comments

Comments
 (0)