// Check for empty enum, because is_useful only works on inhabited types.
let pat_ty = cx.tcx.node_id_to_type(scrut.id);
if inlined_arms.is_empty() {
- if !pat_ty.is_empty(cx.tcx) {
+ if !pat_ty.is_uninhabited(cx.tcx) {
// We know the type is inhabited, so this must be wrong
let mut err = struct_span_err!(cx.tcx.sess, ex.span, E0002,
"non-exhaustive patterns: type {} is non-empty",
possibly adding wildcards or more match arms.");
err.emit();
}
- // If the type *is* empty, it's vacuously exhaustive
+ // If the type *is* uninhabited, it's vacuously exhaustive
return;
}