about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/instance.rs
diff options
context:
space:
mode:
authorYotam Ofek <yotam.ofek@gmail.com>2025-01-19 19:15:00 +0000
committerYotam Ofek <yotam.ofek@gmail.com>2025-01-19 19:15:00 +0000
commit264fa0fc5430f3a9a52a92df706d7c9ac5af4f85 (patch)
tree0bbd37338339064a435083342483f5b6012f4694 /compiler/rustc_middle/src/ty/instance.rs
parent39dc268459b4bd8b771e500169bea67850fad30d (diff)
downloadrust-264fa0fc5430f3a9a52a92df706d7c9ac5af4f85.tar.gz
rust-264fa0fc5430f3a9a52a92df706d7c9ac5af4f85.zip
Run `clippy --fix` for `unnecessary_map_or` lint
Diffstat (limited to 'compiler/rustc_middle/src/ty/instance.rs')
-rw-r--r--compiler/rustc_middle/src/ty/instance.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/ty/instance.rs b/compiler/rustc_middle/src/ty/instance.rs
index e4ded2c30f5..b7a648aae3f 100644
--- a/compiler/rustc_middle/src/ty/instance.rs
+++ b/compiler/rustc_middle/src/ty/instance.rs
@@ -328,7 +328,7 @@ impl<'tcx> InstanceKind<'tcx> {
             // We include enums without destructors to allow, say, optimizing
             // drops of `Option::None` before LTO. We also respect the intent of
             // `#[inline]` on `Drop::drop` implementations.
-            return ty.ty_adt_def().map_or(true, |adt_def| {
+            return ty.ty_adt_def().is_none_or(|adt_def| {
                 match *self {
                     ty::InstanceKind::DropGlue(..) => adt_def.destructor(tcx).map(|dtor| dtor.did),
                     ty::InstanceKind::AsyncDropGlueCtorShim(..) => {