File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1500,10 +1500,11 @@ impl String {
1500
1500
///
1501
1501
/// # Safety
1502
1502
///
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.
1507
1508
///
1508
1509
/// # Examples
1509
1510
///
You can’t perform that action at this time.
0 commit comments