summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2023-05-24 15:05:05 -0700
committerGitHub <noreply@github.com>2023-05-24 15:05:05 -0700
commitd0b3ebee6605b7b04cc81f32c9743db2970349ce (patch)
treeb4820ace7345ed9708e49d1e55ef4e373f1b28bd /compiler/rustc_codegen_ssa
parent33ded73c76b31d25a37ac1c2ea84d03c5a28b215 (diff)
parent307799a711826294bc2b3e562cd87bf1e2ff28b4 (diff)
downloadrust-d0b3ebee6605b7b04cc81f32c9743db2970349ce.tar.gz
rust-d0b3ebee6605b7b04cc81f32c9743db2970349ce.zip
Rollup merge of #111912 - WaffleLapkin:is_some_and_in_the_compiler, r=petrochenkov
Use `Option::is_some_and` and `Result::is_ok_and` in the compiler

`.is_some_and(..)`/`.is_ok_and(..)` replace `.map_or(false, ..)` and `.map(..).unwrap_or(false)`, making the code more readable.

This PR is a sibling of https://github.com/rust-lang/rust/pull/111873#issuecomment-1561316515
Diffstat (limited to 'compiler/rustc_codegen_ssa')
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/block.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs
index a832999225a..1f5f5b69d4d 100644
--- a/compiler/rustc_codegen_ssa/src/mir/block.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/block.rs
@@ -1031,7 +1031,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
         });
 
         let needs_location =
-            instance.map_or(false, |i| i.def.requires_caller_location(self.cx.tcx()));
+            instance.is_some_and(|i| i.def.requires_caller_location(self.cx.tcx()));
         if needs_location {
             let mir_args = if let Some(num_untupled) = num_untupled {
                 first_args.len() + num_untupled