Skip to content

identify traits in libstd that should use associated constants #17825

Description

@pnkfelix

as a subtask of #17307, once associated constants are implemented, we will want to update libstd to use them, rather than continuing to use methods to encode such constants.

A quick ack of the code base via ack --rust 'fn [^\(\)]*\(\) -> Self' shows the following candidate traits for being modified with associated constants:

  • core::default::Default (but this is probably not a great idea; we probably want to continue allowing arbitrary code to be associated with constructing a default value)
  • various numeric traits (but Gankro points out here that perhaps all of these numeric traits will be scrapped in our stdlib anyway)
    • core::num::Zero
    • core::num::One
    • core::num::Bounded
    • core::num::Float
  • core::ptr::RawPtr<T>

Activity

  1. pnkfelix commented on Oct 7, 2014

    @pnkfelix
    ContributorAuthor

    Blocked by #17841.

    Nominating for P-backcompat-libs, not 1.0.

  2. pnkfelix commented on Oct 9, 2014

    @pnkfelix
    ContributorAuthor

    Assigning P-high, not 1.0

  3. aturon commented on Jan 8, 2015

    @aturon
    Contributor

    Closing; this will fall out of the small amount of relevant remaining stabilization (mostly around the num traits).

  4. added a commit that references this issue on Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions