This was previously attempted in https://github.com/rust-lang/rust/pull/19612, but since https://github.com/rust-lang/rust/pull/45225 some of the issues are no longer relevant, so it may be feasible to try this again.
See also Make bool an enum.
https://github.com/rust-lang/rust/pull/19612#issuecomment-66661255
Allows for inherent methods on
str-- but note, it does not allow us to do away with extension traits because some of the operators must be defined inliballoc.
These days we do have inherent methods on str, both in libcore and in liballoc, through lang items that allow these impl blocks despite usual impl coherence rules. If str becomes a struct in libcore, it will still need at least a lang item for liballoc methods.
Most helpful comment
https://github.com/rust-lang/rust/pull/19612#issuecomment-66661255
These days we do have inherent methods on
str, both in libcore and in liballoc, through lang items that allow theseimplblocks despite usual impl coherence rules. Ifstrbecomes a struct in libcore, it will still need at least a lang item for liballoc methods.