From 28503d69ac204ff208d115aea30dc09d6fca8728 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 14 Jul 2024 14:27:57 -0400 Subject: Fix unsafe_op_in_unsafe_fn in compiler --- compiler/rustc_llvm/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_llvm/src') diff --git a/compiler/rustc_llvm/src/lib.rs b/compiler/rustc_llvm/src/lib.rs index e5366c9b518..1365afbce1c 100644 --- a/compiler/rustc_llvm/src/lib.rs +++ b/compiler/rustc_llvm/src/lib.rs @@ -33,7 +33,7 @@ pub unsafe extern "C" fn LLVMRustStringWriteImpl( ptr: *const c_char, size: size_t, ) { - let slice = slice::from_raw_parts(ptr as *const u8, size); + let slice = unsafe { slice::from_raw_parts(ptr as *const u8, size) }; sr.bytes.borrow_mut().extend_from_slice(slice); } -- cgit 1.4.1-3-g733a5