File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1500,10 +1500,11 @@ impl String {
15001500 ///
15011501 /// # Safety
15021502 ///
1503- /// This function is unsafe because it does not check that the bytes passed
1504- /// to it are valid UTF-8. If this constraint is violated, it may cause
1505- /// memory unsafety issues with future users of the `String`, as the rest of
1506- /// the standard library assumes that `String`s are valid UTF-8.
1503+ /// This function is unsafe because the returned `&mut Vec` allows writing
1504+ /// bytes which are not valid UTF-8. If this constraint is violated, using
1505+ /// the original `String` after dropping the `&mut Vec` may violate memory
1506+ /// safety, as the rest of the standard library assumes that `String`s are
1507+ /// valid UTF-8.
15071508 ///
15081509 /// # Examples
15091510 ///
You can’t perform that action at this time.
0 commit comments