@@ -207,15 +207,15 @@ pub unsafe fn create_module<'ll>(
207207 // If skipping the PLT is enabled, we need to add some module metadata
208208 // to ensure intrinsic calls don't use it.
209209 if !sess. needs_plt ( ) {
210- let avoid_plt = c"RtLibUseGOT" . as_ptr ( ) . cast ( ) ;
210+ let avoid_plt = c"RtLibUseGOT" . as_ptr ( ) ;
211211 unsafe {
212212 llvm:: LLVMRustAddModuleFlagU32 ( llmod, llvm:: LLVMModFlagBehavior :: Warning , avoid_plt, 1 ) ;
213213 }
214214 }
215215
216216 // Enable canonical jump tables if CFI is enabled. (See https://reviews.llvm.org/D65629.)
217217 if sess. is_sanitizer_cfi_canonical_jump_tables_enabled ( ) && sess. is_sanitizer_cfi_enabled ( ) {
218- let canonical_jump_tables = c"CFI Canonical Jump Tables" . as_ptr ( ) . cast ( ) ;
218+ let canonical_jump_tables = c"CFI Canonical Jump Tables" . as_ptr ( ) ;
219219 unsafe {
220220 llvm:: LLVMRustAddModuleFlagU32 (
221221 llmod,
@@ -228,7 +228,7 @@ pub unsafe fn create_module<'ll>(
228228
229229 // Enable LTO unit splitting if specified or if CFI is enabled. (See https://reviews.llvm.org/D53891.)
230230 if sess. is_split_lto_unit_enabled ( ) || sess. is_sanitizer_cfi_enabled ( ) {
231- let enable_split_lto_unit = c"EnableSplitLTOUnit" . as_ptr ( ) . cast ( ) ;
231+ let enable_split_lto_unit = c"EnableSplitLTOUnit" . as_ptr ( ) ;
232232 unsafe {
233233 llvm:: LLVMRustAddModuleFlagU32 (
234234 llmod,
@@ -241,7 +241,7 @@ pub unsafe fn create_module<'ll>(
241241
242242 // Add "kcfi" module flag if KCFI is enabled. (See https://reviews.llvm.org/D119296.)
243243 if sess. is_sanitizer_kcfi_enabled ( ) {
244- let kcfi = c"kcfi" . as_ptr ( ) . cast ( ) ;
244+ let kcfi = c"kcfi" . as_ptr ( ) ;
245245 unsafe {
246246 llvm:: LLVMRustAddModuleFlagU32 ( llmod, llvm:: LLVMModFlagBehavior :: Override , kcfi, 1 ) ;
247247 }
@@ -280,26 +280,26 @@ pub unsafe fn create_module<'ll>(
280280 llvm:: LLVMRustAddModuleFlagU32 (
281281 llmod,
282282 llvm:: LLVMModFlagBehavior :: Min ,
283- c"branch-target-enforcement" . as_ptr ( ) . cast ( ) ,
283+ c"branch-target-enforcement" . as_ptr ( ) ,
284284 bti. into ( ) ,
285285 ) ;
286286 llvm:: LLVMRustAddModuleFlagU32 (
287287 llmod,
288288 llvm:: LLVMModFlagBehavior :: Min ,
289- c"sign-return-address" . as_ptr ( ) . cast ( ) ,
289+ c"sign-return-address" . as_ptr ( ) ,
290290 pac_ret. is_some ( ) . into ( ) ,
291291 ) ;
292292 let pac_opts = pac_ret. unwrap_or ( PacRet { leaf : false , key : PAuthKey :: A } ) ;
293293 llvm:: LLVMRustAddModuleFlagU32 (
294294 llmod,
295295 llvm:: LLVMModFlagBehavior :: Min ,
296- c"sign-return-address-all" . as_ptr ( ) . cast ( ) ,
296+ c"sign-return-address-all" . as_ptr ( ) ,
297297 pac_opts. leaf . into ( ) ,
298298 ) ;
299299 llvm:: LLVMRustAddModuleFlagU32 (
300300 llmod,
301301 llvm:: LLVMModFlagBehavior :: Min ,
302- c"sign-return-address-with-bkey" . as_ptr ( ) . cast ( ) ,
302+ c"sign-return-address-with-bkey" . as_ptr ( ) ,
303303 u32:: from ( pac_opts. key == PAuthKey :: B ) ,
304304 ) ;
305305 }
@@ -317,7 +317,7 @@ pub unsafe fn create_module<'ll>(
317317 llvm:: LLVMRustAddModuleFlagU32 (
318318 llmod,
319319 llvm:: LLVMModFlagBehavior :: Override ,
320- c"cf-protection-branch" . as_ptr ( ) . cast ( ) ,
320+ c"cf-protection-branch" . as_ptr ( ) ,
321321 1 ,
322322 ) ;
323323 }
@@ -327,7 +327,7 @@ pub unsafe fn create_module<'ll>(
327327 llvm:: LLVMRustAddModuleFlagU32 (
328328 llmod,
329329 llvm:: LLVMModFlagBehavior :: Override ,
330- c"cf-protection-return" . as_ptr ( ) . cast ( ) ,
330+ c"cf-protection-return" . as_ptr ( ) ,
331331 1 ,
332332 ) ;
333333 }
@@ -338,7 +338,7 @@ pub unsafe fn create_module<'ll>(
338338 llvm:: LLVMRustAddModuleFlagU32 (
339339 llmod,
340340 llvm:: LLVMModFlagBehavior :: Error ,
341- c"Virtual Function Elim" . as_ptr ( ) . cast ( ) ,
341+ c"Virtual Function Elim" . as_ptr ( ) ,
342342 1 ,
343343 ) ;
344344 }
0 commit comments