about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/driver
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-01-10 09:02:07 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-01-10 09:02:07 +0000
commit92a664e111ef7c75ce0b95fc831d5d700f027acf (patch)
treed3a3fd44884a0ddd4ee2d730c8d0d3d1e7becde4 /compiler/rustc_codegen_cranelift/src/driver
parent67951d946a158bc70949150ca06265e912752096 (diff)
parente39eacd2d415803ef82de3b6a314e4f2d0fbc4dc (diff)
downloadrust-92a664e111ef7c75ce0b95fc831d5d700f027acf.tar.gz
rust-92a664e111ef7c75ce0b95fc831d5d700f027acf.zip
Merge commit 'e39eacd2d415803ef82de3b6a314e4f2d0fbc4dc' into sync_cg_clif-2025-01-10
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/driver')
-rw-r--r--compiler/rustc_codegen_cranelift/src/driver/mod.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/driver/mod.rs b/compiler/rustc_codegen_cranelift/src/driver/mod.rs
index fb0eed07c19..ffd47cace38 100644
--- a/compiler/rustc_codegen_cranelift/src/driver/mod.rs
+++ b/compiler/rustc_codegen_cranelift/src/driver/mod.rs
@@ -73,12 +73,14 @@ impl Drop for TimingGuard {
 
 impl cranelift_codegen::timing::Profiler for MeasuremeProfiler {
     fn start_pass(&self, pass: cranelift_codegen::timing::Pass) -> Box<dyn std::any::Any> {
-        let mut timing_guard =
-            TimingGuard { profiler: std::mem::ManuallyDrop::new(self.0.clone()), inner: None };
+        let mut timing_guard = Box::new(TimingGuard {
+            profiler: std::mem::ManuallyDrop::new(self.0.clone()),
+            inner: None,
+        });
         timing_guard.inner = Some(
             unsafe { &*(&*timing_guard.profiler as &SelfProfilerRef as *const SelfProfilerRef) }
                 .generic_activity(pass.description()),
         );
-        Box::new(timing_guard)
+        timing_guard
     }
 }