Skip to content

Remove "placeholder constants" #3131

@workingjubilee

Description

@workingjubilee
Member

It's common for C APIs to define constant values to denote the "last" value in a set of constants, like ELAST or IPPROTO_MAX. This seems prone to weird bugs, and these constants provide very marginal benefit to Rust programmers. Since we're considering some breakage anyways, we should just remove these values where we are made aware of them.

See:

Activity

JohnTitor

JohnTitor commented on Mar 3, 2023

@JohnTitor
Member

👍, before 0.3, I'd like to deprecate these values.

JohnTitor

JohnTitor commented on Apr 19, 2023

@JohnTitor
Member

Noticed that we have a lot of *MAX consts and deprecating manually is quite hard. We could write a script but it can cause a false positive, hmm. For now, I've edited the PR template to mention this concern.

added a commit that references this issue on Apr 19, 2023

295 remaining items

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

    C-bugCategory: bugE-mediumE-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate.breakage-candidate

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Amanieu@tgross35@JohnTitor@workingjubilee

        Issue actions

          Remove "placeholder constants" · Issue #3131 · rust-lang/libc