span_err!(cx.tcx.sess, ex.span, E0002,
"non-exhaustive patterns: type {} is non-empty",
pat_ty);
+ span_help!(cx.tcx.sess, ex.span,
+ "Please ensure that all possible cases are being handled; \
+ possibly adding wildcards or more match arms.");
}
// If the type *is* empty, it's vacuously exhaustive
return;
Err(err) => {
let subspan = p.span.lo <= err.span.lo && err.span.hi <= p.span.hi;
- cx.tcx.sess.span_err(err.span,
- &format!("constant evaluation error: {}",
- err.description()));
+ span_err!(cx.tcx.sess, err.span, E0471,
+ "constant evaluation error: {}",
+ err.description());
if !subspan {
cx.tcx.sess.span_note(p.span,
"in pattern here")
match real_pat.node {
hir::PatIdent(hir::BindByRef(..), _, _) => {
- left_ty.builtin_deref(false).unwrap().ty
+ left_ty.builtin_deref(false, NoPreference).unwrap().ty
}
_ => left_ty,
}