In the past we agreed to get rid of these unsafe functions and replace them with static methods, but they've come back on strings and the previous methods are marked as deprecated. AFAIK, this did not go through an RFC, and is inconsistent with the design used elsewhere in the standard library based on the strong consensus in the previous discussions on the mailing list and issue tracker. For example, from_raw_parts is a method on Vec and was a method on String but has been deprecated.
Static methods play very well with Rust's import system, because it allows accessing all of the methods via the scope. It's already marked unsafe, and going out of the way to make unsafe code painful just makes the language lose appeal as a systems language.
The parameters also shifted around in from_parts relative to from_raw_parts on Vec and String, so even that part of the design is inconsistent with Vec<T>.
In the past we agreed to get rid of these
unsafefunctions and replace them with static methods, but they've come back on strings and the previous methods are marked as deprecated. AFAIK, this did not go through an RFC, and is inconsistent with the design used elsewhere in the standard library based on the strong consensus in the previous discussions on the mailing list and issue tracker. For example,from_raw_partsis a method onVecand was a method onStringbut has been deprecated.Static methods play very well with Rust's import system, because it allows accessing all of the methods via the scope. It's already marked
unsafe, and going out of the way to makeunsafecode painful just makes the language lose appeal as a systems language.The parameters also shifted around in
from_partsrelative tofrom_raw_partson Vec and String, so even that part of the design is inconsistent withVec<T>.