about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/src/consts.rs
diff options
context:
space:
mode:
authorAntoni Boucher <bouanto@zoho.com>2025-04-25 10:44:19 -0400
committerAntoni Boucher <bouanto@zoho.com>2025-04-25 10:44:19 -0400
commit3cd97b644d30c7dc3a48b93ac1b7403ae1cccfab (patch)
tree14a62b99cd2599a0e8abbab21158aecbf0d65962 /compiler/rustc_codegen_gcc/src/consts.rs
parent5c54aa781f97ae95ef01a3120650907b87d385d3 (diff)
parent4f83a4258deb99f3288a7122c0d5a78200931c61 (diff)
downloadrust-3cd97b644d30c7dc3a48b93ac1b7403ae1cccfab.tar.gz
rust-3cd97b644d30c7dc3a48b93ac1b7403ae1cccfab.zip
Merge commit '4f83a4258deb99f3288a7122c0d5a78200931c61' into subtree-update_cg_gcc_2025-04-25
Diffstat (limited to 'compiler/rustc_codegen_gcc/src/consts.rs')
-rw-r--r--compiler/rustc_codegen_gcc/src/consts.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_gcc/src/consts.rs b/compiler/rustc_codegen_gcc/src/consts.rs
index acb39374628..0a67bd7bc71 100644
--- a/compiler/rustc_codegen_gcc/src/consts.rs
+++ b/compiler/rustc_codegen_gcc/src/consts.rs
@@ -242,10 +242,10 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
         let fn_attrs = self.tcx.codegen_fn_attrs(def_id);
 
         let global = if def_id.is_local() && !self.tcx.is_foreign_item(def_id) {
-            if let Some(global) = self.get_declared_value(sym) {
-                if self.val_ty(global) != self.type_ptr_to(gcc_type) {
-                    span_bug!(self.tcx.def_span(def_id), "Conflicting types for static");
-                }
+            if let Some(global) = self.get_declared_value(sym)
+                && self.val_ty(global) != self.type_ptr_to(gcc_type)
+            {
+                span_bug!(self.tcx.def_span(def_id), "Conflicting types for static");
             }
 
             let is_tls = fn_attrs.flags.contains(CodegenFnAttrFlags::THREAD_LOCAL);