use .all
instead of negative use of .any
This commit is contained in:
parent
e322c773e3
commit
e812a8abde
1 changed files with 3 additions and 3 deletions
|
@ -1506,13 +1506,13 @@ fn is_normalizable_helper<'tcx>(
|
||||||
let cause = rustc_middle::traits::ObligationCause::dummy();
|
let cause = rustc_middle::traits::ObligationCause::dummy();
|
||||||
if infcx.at(&cause, param_env).normalize(ty).is_ok() {
|
if infcx.at(&cause, param_env).normalize(ty).is_ok() {
|
||||||
match ty.kind() {
|
match ty.kind() {
|
||||||
ty::Adt(def, substs) => !def.variants.iter().any(|variant| {
|
ty::Adt(def, substs) => def.variants.iter().all(|variant| {
|
||||||
variant
|
variant
|
||||||
.fields
|
.fields
|
||||||
.iter()
|
.iter()
|
||||||
.any(|field| !is_normalizable_helper(cx, param_env, field.ty(cx.tcx, substs), cache))
|
.all(|field| is_normalizable_helper(cx, param_env, field.ty(cx.tcx, substs), cache))
|
||||||
}),
|
}),
|
||||||
_ => !ty.walk().any(|generic_arg| !match generic_arg.unpack() {
|
_ => ty.walk().all(|generic_arg| match generic_arg.unpack() {
|
||||||
GenericArgKind::Type(inner_ty) if inner_ty != ty => {
|
GenericArgKind::Type(inner_ty) if inner_ty != ty => {
|
||||||
is_normalizable_helper(cx, param_env, inner_ty, cache)
|
is_normalizable_helper(cx, param_env, inner_ty, cache)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue