about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/lib.rs
diff options
context:
space:
mode:
authorPavel Grigorenko <grigorenkopv@ya.ru>2024-02-24 16:47:34 +0300
committerPavel Grigorenko <grigorenkopv@ya.ru>2024-02-24 18:53:48 +0300
commit613cb3262dfca935cac5a198f835f2aaa73faf18 (patch)
treede03bf05a980d6c018c4db381d72c174bf16f1de /compiler/rustc_codegen_llvm/src/lib.rs
parentff187a92d84f352670a9a63e8519eac114456d38 (diff)
downloadrust-613cb3262dfca935cac5a198f835f2aaa73faf18.tar.gz
rust-613cb3262dfca935cac5a198f835f2aaa73faf18.zip
compiler: use `addr_of!`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/lib.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs
index 35210b0b2e8..c84461e53eb 100644
--- a/compiler/rustc_codegen_llvm/src/lib.rs
+++ b/compiler/rustc_codegen_llvm/src/lib.rs
@@ -169,7 +169,7 @@ impl WriteBackendMethods for LlvmCodegenBackend {
     fn print_pass_timings(&self) {
         unsafe {
             let mut size = 0;
-            let cstr = llvm::LLVMRustPrintPassTimings(&mut size as *mut usize);
+            let cstr = llvm::LLVMRustPrintPassTimings(std::ptr::addr_of_mut!(size));
             if cstr.is_null() {
                 println!("failed to get pass timings");
             } else {
@@ -182,7 +182,7 @@ impl WriteBackendMethods for LlvmCodegenBackend {
     fn print_statistics(&self) {
         unsafe {
             let mut size = 0;
-            let cstr = llvm::LLVMRustPrintStatistics(&mut size as *mut usize);
+            let cstr = llvm::LLVMRustPrintStatistics(std::ptr::addr_of_mut!(size));
             if cstr.is_null() {
                 println!("failed to get pass stats");
             } else {