remove workaround that prints error messages with TyErr
now that normalize_to_error no longer creates these, it is unnecessary.
This commit is contained in:
parent
953c3b5f50
commit
513d9f208c
1 changed files with 1 additions and 6 deletions
|
@ -90,12 +90,7 @@ 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 TyError created by normalize_to_error can end up being unified
|
if !predicate.references_error() {
|
||||||
// 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 TyError, but the error still needs to be
|
|
||||||
// reported.
|
|
||||||
if !infcx.tcx.sess.has_errors() || !predicate.references_error() {
|
|
||||||
let mut err = struct_span_err!(infcx.tcx.sess, obligation.cause.span, E0271,
|
let mut err = struct_span_err!(infcx.tcx.sess, obligation.cause.span, E0271,
|
||||||
"type mismatch resolving `{}`: {}",
|
"type mismatch resolving `{}`: {}",
|
||||||
predicate,
|
predicate,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue