Skip to content

Should we keep un-deriving traits in library to make them const? #102371

Closed
@scottmcm

Description

@scottmcm
Member

PRs like https://github.com/rust-lang/rust/pull/101698/files#diff-0752889661748b8a15a597d7156127b6fb90fdeda0627be50e07f3f785bd0f4dR678 stop using derives for traits because the derives can't make things const.

Should we maybe stop doing this in library until there's a way to #[const_derive(Ord)] or similar? It looks like we're on track to stop deriving essentially anything, which seems like a bad worldstate.

Activity

added
T-libsRelevant to the library team, which will review and decide on the PR/issue.
I-libs-nominatedNominated for discussion during a libs team meeting.
on Sep 27, 2022
Mark-Simulacrum

Mark-Simulacrum commented on Sep 27, 2022

@Mark-Simulacrum
Member

Can we get input from @rust-lang/wg-const-eval (not sure this is the right group) on the general trajectory for const impls? It was my recollection that we wanted to potentially back out the const-ification of std's traits until we had a more solid plan on that feature -- ~const and the lack of derives here is adding a lot of noise and it's not clear to me that we're not going to need to change all of these sites anyway once the feature is more complete and e.g. syntax changes.

onestacked

onestacked commented on Sep 27, 2022

@onestacked
Contributor

@fee1-dead has a PR for #[derive_const] #102049

m-ou-se

m-ou-se commented on Sep 28, 2022

@m-ou-se
Member

Should we maybe stop doing this in library until there's a way to #[const_derive(Ord)] or similar?

We discussed this in the libs meeting, and agreed that yes, we should not start changing from derives to hand-written impls everywhere just for const. #102049 looks like a good way forward for now.

removed
I-libs-nominatedNominated for discussion during a libs team meeting.
on Sep 28, 2022
added 3 commits that reference this issue on Nov 11, 2022

Rollup merge of rust-lang#102049 - fee1-dead-contrib:derive_const, r=…

395ee0b

Rollup merge of rust-lang#102049 - fee1-dead-contrib:derive_const, r=…

f88bbba

Rollup merge of rust-lang#102049 - fee1-dead-contrib:derive_const, r=…

2c5a883
added a commit that references this issue on Nov 12, 2022

Rollup merge of rust-lang#102049 - fee1-dead-contrib:derive_const, r=…

4b0b898
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

    T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @m-ou-se@Mark-Simulacrum@onestacked@scottmcm

      Issue actions

        Should we keep un-deriving traits in `library` to make them `const`? · Issue #102371 · rust-lang/rust