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> {
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);
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);
}