Skip to content

Commit 5543da9

Browse files
authored
Rollup merge of #124100 - dev-ardi:master, r=workingjubilee
fix: make `str::from_raw_parts_mut` `mut` `str::from_raw_parts_mut` wasn't actually `mut` #119206
2 parents 90013ff + 9cc9ba5 commit 5543da9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/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)