Skip to content

refactor deprecate *LAST constants fitting #3131#5120

Open
dybucc wants to merge 1 commit into
rust-lang:mainfrom
dybucc:_last-deprecation
Open

refactor deprecate *LAST constants fitting #3131#5120
dybucc wants to merge 1 commit into
rust-lang:mainfrom
dybucc:_last-deprecation

Conversation

@dybucc
Copy link
Copy Markdown
Contributor

@dybucc dybucc commented May 28, 2026

Description

Constants matching the *LAST naming scheme, and whose purpose fits that of a "delimitter" value have
been deprecated as part of the deprecation efforts stemming from #3131.

This patch starts deprecation of symbols matching one of the most common suffixes in identifiers for
constants whose value fits that of a "limit." The changes here follow from those in
#3620, with the recommended fixes by Amanieu (not pinging for now.)

Notes

I couldn't look into the QNX _NTO_HOOK_LAST constant because I could not find any information on
the headers in that target.

While looking into the UTX_DB_LASTLOG constant in the DragonFly BSD upstream repo, I realized
there was no symbol by that name. There is, though, a very similar constant, going by the identifier
of UTX_DB_LASTLOGX (note the trailing X.) It does not seem like that one symbol has been changed
recently judging by the git blame output of the containing file. The last modification to the part
of the header where the constant is declared was 16 years ago. We may be defining a misspelled
constant in the libc crate, though I can open a PR changing it if that's, indeed, the case.

In the Linux source, I was hesitant to deprecate NF_IP_PRI_SELINUX_LAST the same way I did with
NF_IP_PRI_LAST because that does not seem to be a trailing enumeration member nor does it
necessarily imply that it exists for the purpose of serving as a limit/bound on some other value(s).
Further, looking into section "Priority within hook" of [1], I found that this SELINUX-tagged
symbol did have some significance, so I've not deprecated it even though no comments were made
against its removal in #3620.

I also couldn't get hold of Solaris sources, though I assumed that the _PC_LAST constant served
the same purpose as in illumos, where I did get to check the headers.

I'm not sure if we should deprecate the LC_ALL_MASK constant in OpenBSD, as that seems to be used
as a simpler way of getting a bitmask with all bits for each of the LC_ constants set.

Sources

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 28, 2026

Some changes occurred in a NetBSD-like module

cc @semarie

Some changes occurred in an OpenBSD module

cc @semarie

Some changes occurred in a solarish module

cc @jclulow, @pfmooney

Some changes occurred in an Android module

cc @maurer

@rustbot

This comment has been minimized.

@dybucc dybucc force-pushed the _last-deprecation branch from 655cbe6 to 55dce9c Compare May 28, 2026 10:41
@rustbot

This comment has been minimized.

@dybucc dybucc force-pushed the _last-deprecation branch 2 times, most recently from 6d89662 to ff01f04 Compare May 28, 2026 10:44
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 28, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@dybucc dybucc force-pushed the _last-deprecation branch 2 times, most recently from d549bd3 to 05d5fe8 Compare May 28, 2026 10:56
Constants matching the *LAST naming scheme, and whose purpose fits that
of a "delimitter" value have been deprecated as part of the deprecation
efforts stemming in rust-lang#3131.
@dybucc dybucc force-pushed the _last-deprecation branch from 05d5fe8 to bd2bb5b Compare May 28, 2026 12:04
@dybucc dybucc changed the title refactor deprecate *LAST constants fitting #3131 refactor deprecate *LAST constants fitting #3131 May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants