about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src
diff options
context:
space:
mode:
authorKivooeo <Kivooeo123@gmail.com>2025-07-26 06:22:20 +0500
committerKivooeo <Kivooeo123@gmail.com>2025-07-28 06:10:36 +0500
commitb8eb046e6ee3294969bf8faf31da226b0ea29d18 (patch)
treec86381dc96242b7de6bff882a53df40a8eb86b55 /compiler/rustc_ty_utils/src
parentbae38bad7803be7fdf1878188da9650f82548016 (diff)
downloadrust-b8eb046e6ee3294969bf8faf31da226b0ea29d18.tar.gz
rust-b8eb046e6ee3294969bf8faf31da226b0ea29d18.zip
use let chains in mir, resolve, target
Diffstat (limited to 'compiler/rustc_ty_utils/src')
-rw-r--r--compiler/rustc_ty_utils/src/abi.rs10
-rw-r--r--compiler/rustc_ty_utils/src/ty.rs8
2 files changed, 9 insertions, 9 deletions
diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs
index f0ff50318ab..af2e000e340 100644
--- a/compiler/rustc_ty_utils/src/abi.rs
+++ b/compiler/rustc_ty_utils/src/abi.rs
@@ -642,11 +642,11 @@ fn fn_abi_adjust_for_abi<'tcx>(
                 // The `deduced_param_attrs` list could be empty if this is a type of function
                 // we can't deduce any parameters for, so make sure the argument index is in
                 // bounds.
-                if let Some(deduced_param_attrs) = deduced_param_attrs.get(arg_idx) {
-                    if deduced_param_attrs.read_only {
-                        attrs.regular.insert(ArgAttribute::ReadOnly);
-                        debug!("added deduced read-only attribute");
-                    }
+                if let Some(deduced_param_attrs) = deduced_param_attrs.get(arg_idx)
+                    && deduced_param_attrs.read_only
+                {
+                    attrs.regular.insert(ArgAttribute::ReadOnly);
+                    debug!("added deduced read-only attribute");
                 }
             }
         }
diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs
index f8d793464a9..8e09a4a8996 100644
--- a/compiler/rustc_ty_utils/src/ty.rs
+++ b/compiler/rustc_ty_utils/src/ty.rs
@@ -106,10 +106,10 @@ fn adt_sizedness_constraint<'tcx>(
     tcx: TyCtxt<'tcx>,
     (def_id, sizedness): (DefId, SizedTraitKind),
 ) -> Option<ty::EarlyBinder<'tcx, Ty<'tcx>>> {
-    if let Some(def_id) = def_id.as_local() {
-        if let ty::Representability::Infinite(_) = tcx.representability(def_id) {
-            return None;
-        }
+    if let Some(def_id) = def_id.as_local()
+        && let ty::Representability::Infinite(_) = tcx.representability(def_id)
+    {
+        return None;
     }
     let def = tcx.adt_def(def_id);