diff --git a/compiler/rustc_resolve/src/check_unused.rs b/compiler/rustc_resolve/src/check_unused.rs index 3080a0c9892dd..e36055e85755e 100644 --- a/compiler/rustc_resolve/src/check_unused.rs +++ b/compiler/rustc_resolve/src/check_unused.rs @@ -184,11 +184,11 @@ impl<'a, 'ra, 'tcx> UnusedImportCheckVisitor<'a, 'ra, 'tcx> { // If the extern crate isn't in the extern prelude, // there is no way it can be written as a `use`. - if !self + if self .r .extern_prelude .get(&extern_crate.ident) - .is_some_and(|entry| !entry.introduced_by_item) + .is_none_or(|entry| entry.introduced_by_item) { continue; } diff --git a/compiler/rustc_type_ir/src/search_graph/mod.rs b/compiler/rustc_type_ir/src/search_graph/mod.rs index f4fb03562de9c..3fd2bb61ba583 100644 --- a/compiler/rustc_type_ir/src/search_graph/mod.rs +++ b/compiler/rustc_type_ir/src/search_graph/mod.rs @@ -714,7 +714,7 @@ impl, X: Cx> SearchGraph { // current goal is already part of the same cycle. This check could be // improved but seems to be good enough for now. let last = self.stack.raw.last().unwrap(); - if !last.heads.opt_lowest_cycle_head().is_some_and(|lowest| lowest <= head) { + if last.heads.opt_lowest_cycle_head().is_none_or(|lowest| lowest > head) { continue; } }