This commit is contained in:
Nadrieril 2019-10-27 16:17:00 +00:00
parent a5de5a604e
commit af35934fa5

View File

@ -1537,13 +1537,14 @@ fn constructor_sub_pattern_tys<'a, 'tcx>(
(_, true, true) => cx.tcx.types.err,
// Treat all non-visible fields as `TyErr`. They can't appear in any
// other pattern from this match (because they are private), so their
// type does not matter - but we don't want to know they are uninhabited.
// type does not matter - but we don't want to know they are
// uninhabited.
(false, ..) => cx.tcx.types.err,
(true, ..) => {
let ty = field.ty(cx.tcx, substs);
match ty.kind {
// If the field type returned is an array of an unknown
// size return an TyErr.
// If the field type returned is an array of an unknown size
// return an TyErr.
ty::Array(_, len)
if len.try_eval_usize(cx.tcx, cx.param_env).is_none() =>
{