Skip to content

Commit

Permalink
improve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
arielb1 committed May 6, 2015
1 parent 4d8d68f commit df42976
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/librustc/middle/traits/error_reporting.rs
Expand Up @@ -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 `{}`: {}",
Expand Down

0 comments on commit df42976

Please sign in to comment.