diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-02-24 14:38:55 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-02-24 15:11:29 +0000 |
| commit | 553828c6f48adcf3f2443bf1972909db518e3c89 (patch) | |
| tree | de0be34cfbbf4712e04b8fb3a0bfe47d5a8a3aef /compiler/rustc_codegen_llvm/src/builder.rs | |
| parent | 3565603d2522cb96f52b74dba3d64f5869a5ad4c (diff) | |
| download | rust-553828c6f48adcf3f2443bf1972909db518e3c89.tar.gz rust-553828c6f48adcf3f2443bf1972909db518e3c89.zip | |
Mark more LLVM FFI as safe
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/builder.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/builder.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index 17579ebe72c..7e8b2467989 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -311,8 +311,8 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { // This function handles switch instructions with more than 2 targets and it needs to // emit branch weights metadata instead of using the intrinsic. // The values 1 and 2000 are the same as the values used by the `llvm.expect` intrinsic. - let cold_weight = unsafe { llvm::LLVMValueAsMetadata(self.cx.const_u32(1)) }; - let hot_weight = unsafe { llvm::LLVMValueAsMetadata(self.cx.const_u32(2000)) }; + let cold_weight = llvm::LLVMValueAsMetadata(self.cx.const_u32(1)); + let hot_weight = llvm::LLVMValueAsMetadata(self.cx.const_u32(2000)); let weight = |is_cold: bool| -> &Metadata { if is_cold { cold_weight } else { hot_weight } }; |
