]> git.lizzy.rs Git - rust.git/commitdiff
remove workaround that prints error messages with TyErr
authorAriel Ben-Yehuda <arielb1@mail.tau.ac.il>
Tue, 29 Mar 2016 16:10:39 +0000 (19:10 +0300)
committerAriel Ben-Yehuda <ariel.byd@gmail.com>
Tue, 5 Apr 2016 17:58:58 +0000 (20:58 +0300)
now that normalize_to_error no longer creates these, it is unnecessary.

src/librustc/traits/error_reporting.rs

index f15b9ee44ce5293480e29c80d72196168da1ffe9..cbcac7f9aa4883658552150cbdcecca6c504850c 100644 (file)
@@ -90,12 +90,7 @@ pub fn report_projection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
     let predicate =
         infcx.resolve_type_vars_if_possible(&obligation.predicate);
 
-    // The TyError created by normalize_to_error can end up being unified
-    // 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() {
+    if !predicate.references_error() {
         let mut err = struct_span_err!(infcx.tcx.sess, obligation.cause.span, E0271,
             "type mismatch resolving `{}`: {}",
             predicate,