Skip to content

Commit 9699e68

Browse files
committed
fix: make str::from_raw_parts_mut mut
1 parent a1dfa79 commit 9699e68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/str/converts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ pub const unsafe fn from_raw_parts<'a>(ptr: *const u8, len: usize) -> &'a str {
239239
#[must_use]
240240
#[unstable(feature = "str_from_raw_parts", issue = "119206")]
241241
#[rustc_const_unstable(feature = "const_str_from_raw_parts_mut", issue = "119206")]
242-
pub const unsafe fn from_raw_parts_mut<'a>(ptr: *mut u8, len: usize) -> &'a str {
242+
pub const unsafe fn from_raw_parts_mut<'a>(ptr: *mut u8, len: usize) -> &'a mut str {
243243
// SAFETY: the caller must uphold the safety contract for `from_raw_parts_mut`.
244244
unsafe { &mut *ptr::from_raw_parts_mut(ptr.cast(), len) }
245245
}

0 commit comments

Comments
 (0)