Skip to content

Commit 513d9f2

Browse files
Ariel Ben-Yehudaarielb1
Ariel Ben-Yehuda
authored andcommitted
remove workaround that prints error messages with TyErr
now that normalize_to_error no longer creates these, it is unnecessary.
1 parent 953c3b5 commit 513d9f2

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/librustc/traits/error_reporting.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,7 @@ pub fn report_projection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
9090
let predicate =
9191
infcx.resolve_type_vars_if_possible(&obligation.predicate);
9292

93-
// The TyError created by normalize_to_error can end up being unified
94-
// into all obligations: for example, if our obligation is something
95-
// like `$X = <() as Foo<$X>>::Out` and () does not implement Foo<_>,
96-
// then $X will be unified with TyError, but the error still needs to be
97-
// reported.
98-
if !infcx.tcx.sess.has_errors() || !predicate.references_error() {
93+
if !predicate.references_error() {
9994
let mut err = struct_span_err!(infcx.tcx.sess, obligation.cause.span, E0271,
10095
"type mismatch resolving `{}`: {}",
10196
predicate,

0 commit comments

Comments
 (0)