about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2023-02-15 11:43:41 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2023-02-16 15:26:00 +0000
commit8751fa1a9abda9fc7ced6b03315efbd82310830d (patch)
treef15613d5ca2fa5aadfdde2df1d94907d1798a5bb /compiler/rustc_codegen_cranelift
parentaf3c8b27266e290cf65704284f6862d0f90ee4fc (diff)
downloadrust-8751fa1a9abda9fc7ced6b03315efbd82310830d.tar.gz
rust-8751fa1a9abda9fc7ced6b03315efbd82310830d.zip
`if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)`
Diffstat (limited to 'compiler/rustc_codegen_cranelift')
-rw-r--r--compiler/rustc_codegen_cranelift/src/driver/aot.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/driver/aot.rs b/compiler/rustc_codegen_cranelift/src/driver/aot.rs
index 58b01dfb5b0..7c6fd9f6f1e 100644
--- a/compiler/rustc_codegen_cranelift/src/driver/aot.rs
+++ b/compiler/rustc_codegen_cranelift/src/driver/aot.rs
@@ -248,17 +248,13 @@ fn reuse_workproduct_for_cgu(
             dwarf_object: None,
             bytecode: None,
         },
-        module_global_asm: if has_global_asm {
-            Some(CompiledModule {
-                name: cgu.name().to_string(),
-                kind: ModuleKind::Regular,
-                object: Some(obj_out_global_asm),
-                dwarf_object: None,
-                bytecode: None,
-            })
-        } else {
-            None
-        },
+        module_global_asm: has_global_asm.then(|| CompiledModule {
+            name: cgu.name().to_string(),
+            kind: ModuleKind::Regular,
+            object: Some(obj_out_global_asm),
+            dwarf_object: None,
+            bytecode: None,
+        }),
         existing_work_product: Some((cgu.work_product_id(), work_product)),
     })
 }