about summary refs log tree commit diff
path: root/compiler/rustc_privacy
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_privacy
parentbae38bad7803be7fdf1878188da9650f82548016 (diff)
downloadrust-b8eb046e6ee3294969bf8faf31da226b0ea29d18.tar.gz
rust-b8eb046e6ee3294969bf8faf31da226b0ea29d18.zip
use let chains in mir, resolve, target
Diffstat (limited to 'compiler/rustc_privacy')
-rw-r--r--compiler/rustc_privacy/src/lib.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs
index 6fd2b7fc12f..b4fa11a8eb3 100644
--- a/compiler/rustc_privacy/src/lib.rs
+++ b/compiler/rustc_privacy/src/lib.rs
@@ -204,12 +204,10 @@ where
                 // Something like `fn() {my_method}` type of the method
                 // `impl Pub<Priv> { pub fn my_method() {} }` is considered a private type,
                 // so we need to visit the self type additionally.
-                if let Some(assoc_item) = tcx.opt_associated_item(def_id) {
-                    if let Some(impl_def_id) = assoc_item.impl_container(tcx) {
-                        try_visit!(
-                            tcx.type_of(impl_def_id).instantiate_identity().visit_with(self)
-                        );
-                    }
+                if let Some(assoc_item) = tcx.opt_associated_item(def_id)
+                    && let Some(impl_def_id) = assoc_item.impl_container(tcx)
+                {
+                    try_visit!(tcx.type_of(impl_def_id).instantiate_identity().visit_with(self));
                 }
             }
             ty::Alias(kind @ (ty::Inherent | ty::Free | ty::Projection), data) => {
@@ -734,6 +732,7 @@ impl<'tcx> Visitor<'tcx> for EmbargoVisitor<'tcx> {
                         if let Some(ctor_def_id) = variant.data.ctor_def_id() {
                             self.update(ctor_def_id, variant_ev, Level::Reachable);
                         }
+
                         for field in variant.data.fields() {
                             self.update(field.def_id, variant_ev, Level::Reachable);
                             self.reach(field.def_id, variant_ev).ty();