improve comment
This commit is contained in:
parent
4d8d68f80d
commit
df42976e4d
1 changed files with 4 additions and 2 deletions
|
@ -57,8 +57,10 @@ pub fn report_projection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
|
||||||
let predicate =
|
let predicate =
|
||||||
infcx.resolve_type_vars_if_possible(&obligation.predicate);
|
infcx.resolve_type_vars_if_possible(&obligation.predicate);
|
||||||
// The ty_err created by normalize_to_error can end up being unified
|
// 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
|
// into all obligations: for example, if our obligation is something
|
||||||
// case.
|
// 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() {
|
if !infcx.tcx.sess.has_errors() || !predicate.references_error() {
|
||||||
span_err!(infcx.tcx.sess, obligation.cause.span, E0271,
|
span_err!(infcx.tcx.sess, obligation.cause.span, E0271,
|
||||||
"type mismatch resolving `{}`: {}",
|
"type mismatch resolving `{}`: {}",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue