about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2025-01-20 12:37:56 +0800
committerGitHub <noreply@github.com>2025-01-20 12:37:56 +0800
commitf3f21ae6a4e9e4b88192f0016eac9ceaa5513389 (patch)
tree40d1bcaf6634d24cb62fb9f8533536adb6d7a2fd /compiler/rustc_codegen_llvm/src
parent64768c56305cf0c139c0de280f1191cd8258193b (diff)
parent1951d86a35c2b7d5c5434493f1897425cbfd8e96 (diff)
downloadrust-f3f21ae6a4e9e4b88192f0016eac9ceaa5513389.tar.gz
rust-f3f21ae6a4e9e4b88192f0016eac9ceaa5513389.zip
Rollup merge of #135738 - yotamofek:map_or_true-compiler, r=compiler-errors
Replace usages of `map_or(bool, ...)` with `is_{some_and|none_or|ok_and}`

Split out from #135732 according to https://github.com/rust-lang/rust/pull/135732?pullrequestreview-2561072330 ,
same thing but just for the compiler:

> The usage of `map_or(bool, ...)` is really hard to understand IMHO.
> This PR simply uses clippy (with `--fix`) to replace that with `is_{some_and|none_or|ok_and}`.
> (no manual modifications were made, just machine applicable clippy fixes and then fmt)

r? ``@compiler-errors``
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
index 88e43e1c678..8d782a618fc 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
@@ -442,7 +442,7 @@ pub(crate) fn type_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) ->
         // (or if there is no allocator argument).
         ty::Adt(def, args)
             if def.is_box()
-                && args.get(1).map_or(true, |arg| cx.layout_of(arg.expect_ty()).is_1zst()) =>
+                && args.get(1).is_none_or(|arg| cx.layout_of(arg.expect_ty()).is_1zst()) =>
         {
             build_pointer_or_reference_di_node(cx, t, t.expect_boxed_ty(), unique_type_id)
         }