]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/coercion.rs
Update src/libcore/mem.rs
[rust.git] / src / librustc_typeck / check / coercion.rs
index d21ceb983f8f4cf6f2ef0843a2199ef68270a822..90b2643d165bea7f2ab6e23cfacbb56ae5a53a85 100644 (file)
@@ -68,6 +68,7 @@
 use std::ops::Deref;
 use syntax::feature_gate;
 use syntax::ptr::P;
+use syntax::symbol::sym;
 use syntax_pos;
 
 struct Coerce<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
@@ -620,7 +621,7 @@ fn coerce_unsized(&self, source: Ty<'tcx>, target: Ty<'tcx>) -> CoerceResult<'tc
 
         if has_unsized_tuple_coercion && !self.tcx.features().unsized_tuple_coercion {
             feature_gate::emit_feature_err(&self.tcx.sess.parse_sess,
-                                           "unsized_tuple_coercion",
+                                           sym::unsized_tuple_coercion,
                                            self.cause.span,
                                            feature_gate::GateIssue::Language,
                                            feature_gate::EXPLAIN_UNSIZED_TUPLE_COERCION);
@@ -1248,12 +1249,8 @@ fn coerce_inner<'a>(&mut self,
                     augment_error(&mut db);
                 }
 
-                if expression.filter(|e| fcx.is_assign_to_bool(e, expected)).is_some() {
-                    // Error reported in `check_assign` so avoid emitting error again.
-                    db.delay_as_bug();
-                } else {
-                    db.emit();
-                }
+                // Error possibly reported in `check_assign` so avoid emitting error again.
+                db.emit_unless(expression.filter(|e| fcx.is_assign_to_bool(e, expected)).is_some());
 
                 self.final_ty = Some(fcx.tcx.types.err);
             }