Skip to content

Allow multiple inherent impls on primitive types #32631

Closed
@alexcrichton

Description

@alexcrichton

In the standard library it's pretty unfortunate that we have to redefine all methods on string, slice, characters, and floating point types in libraries outside of libcore with an inherent methods. It's also unfortunate to have all the extension traits in libcore.

Let's just bite the bullet and allow multiple inherent impls on this type. It will...

  • Reduce duplication (thereby preventing drift between API surface area)
  • Remove unstable traits
  • Perhaps be simpler in terms of resolve

We'll have to be sure to update rustdoc, however, to provide one unified view to the API surface area rather than multiple impl blocks.

cc @rust-lang/libs

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-acceptedCategory: A feature request that has been accepted pending implementation.T-langRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions