Skip to content

Commit

Permalink
use .all instead of negative use of .any
Browse files Browse the repository at this point in the history
  • Loading branch information
anall committed Mar 9, 2021
1 parent e322c77 commit e812a8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clippy_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1506,13 +1506,13 @@ fn is_normalizable_helper<'tcx>(
let cause = rustc_middle::traits::ObligationCause::dummy();
if infcx.at(&cause, param_env).normalize(ty).is_ok() {
match ty.kind() {
ty::Adt(def, substs) => !def.variants.iter().any(|variant| {
ty::Adt(def, substs) => def.variants.iter().all(|variant| {
variant
.fields
.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 => {
is_normalizable_helper(cx, param_env, inner_ty, cache)
},
Expand Down

0 comments on commit e812a8a

Please sign in to comment.