about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/check_consts/check.rs
diff options
context:
space:
mode:
authorKivooeo <Kivooeo123@gmail.com>2025-07-26 06:21:22 +0500
committerKivooeo <Kivooeo123@gmail.com>2025-07-28 06:08:48 +0500
commit43725ed819c57b86b32a66c40572246b1f5b8952 (patch)
tree52149f83843b22ea6b0e039662a1a7348ce360e5 /compiler/rustc_const_eval/src/check_consts/check.rs
parenta955f1cd09a027363729ceed919952d09f76f28e (diff)
downloadrust-43725ed819c57b86b32a66c40572246b1f5b8952.tar.gz
rust-43725ed819c57b86b32a66c40572246b1f5b8952.zip
use let chains in ast, borrowck, codegen, const_eval
Diffstat (limited to 'compiler/rustc_const_eval/src/check_consts/check.rs')
-rw-r--r--compiler/rustc_const_eval/src/check_consts/check.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_const_eval/src/check_consts/check.rs b/compiler/rustc_const_eval/src/check_consts/check.rs
index 0eb6f28bdb3..69637cadcc9 100644
--- a/compiler/rustc_const_eval/src/check_consts/check.rs
+++ b/compiler/rustc_const_eval/src/check_consts/check.rs
@@ -714,10 +714,10 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
 
     fn visit_operand(&mut self, op: &Operand<'tcx>, location: Location) {
         self.super_operand(op, location);
-        if let Operand::Constant(c) = op {
-            if let Some(def_id) = c.check_static_ptr(self.tcx) {
-                self.check_static(def_id, self.span);
-            }
+        if let Operand::Constant(c) = op
+            && let Some(def_id) = c.check_static_ptr(self.tcx)
+        {
+            self.check_static(def_id, self.span);
         }
     }