refactor deprecate *LAST constants fitting #3131#5120
Open
dybucc wants to merge 2 commits into
Open
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6d89662 to
ff01f04
Compare
This comment has been minimized.
This comment has been minimized.
05d5fe8 to
bd2bb5b
Compare
This was referenced May 28, 2026
*LAST constants fitting #3131
3 tasks
bf8abd7 to
b1ea172
Compare
This comment has been minimized.
This comment has been minimized.
3 tasks
dybucc
added a commit
to dybucc/libc
that referenced
this pull request
Jun 8, 2026
This patch is a follow up to rust-lang#5120. That PR deprecated the now removed symbols such that it could be included in a stable release. This patch targets the 1.0 release, by altogether removinga the symbols and updating the SemVer-tracking file. See the accompanying PR for more details.
dybucc
added a commit
to dybucc/libc
that referenced
this pull request
Jun 9, 2026
This patch is a follow up to rust-lang#5120. That PR deprecated the now removed symbols such that it could be included in a stable release. This patch targets the 1.0 release, by altogether removinga the symbols and updating the SemVer-tracking file. See the accompanying PR for more details.
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
CI actually passes. There seems to be an issue with a glob import that is not used, but this has not |
dybucc
added a commit
to dybucc/libc
that referenced
this pull request
Jun 15, 2026
This patch is a follow up to rust-lang#5120. That PR deprecated the now removed symbols such that it could be included in a stable release. This patch targets the 1.0 release, by altogether removinga the symbols and updating the SemVer-tracking file. See the accompanying PR for more details.
8e5ad96 to
8c7d21e
Compare
This comment has been minimized.
This comment has been minimized.
This patch adds a new macro that can be used for declaring constants when these are known to possibly change upstream across target OS/ABI versions.
Constants matching the *LAST naming scheme, and whose purpose fits that of a "delimitter" value have been annotated with a documentation comment pointing to updated usage guidelines for the libc crate.
3 tasks
8c7d21e to
d6d6fcd
Compare
Collaborator
|
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. |
Contributor
|
For updating doc comments like the others, @rustbot author |
Collaborator
|
Reminder, once the PR becomes ready for a review, use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Constants matching the
*LASTnaming 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_LASTconstant because I could not find any information on the headers in that target.While looking into the
UTX_DB_LASTLOGconstant 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 ofUTX_DB_LASTLOGX(note the trailingX.) It does not seem like that one symbol has been changed recently judging by thegit blameoutput 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 thelibccrate, 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_LASTthe same way I did withNF_IP_PRI_LASTbecause 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 thisSELINUX-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_LASTconstant 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_MASKconstant in OpenBSD, as that seems to be used as a simpler way of getting a bitmask with all bits for each of theLC_constants set.Sources
FreeBSD manpage detailing how
UTXDB_LASTLOGINis not the type of constant we would want to deprecate.DragonFlyBSD sources showing how they define a
UTX_DB_LASTLOGXsymbol but not aUTX_DB_LASTLOGsymbol as we do.Android sources showing how they use the
NF_*_PRI_LASTin much the same manner as the Linux sources (further below.)Linux sources showing the use of
NF_*_PRI_LASTconstants as trailing enumeration constants defined in terms of large values.Illumos sources showing how
_PC_LASTshould be changed when adding new_PCconstants.OpenBSD sources showing how
_LC_LASTserves as the "end" value for constants defined prior to it.Checklist
libc-test/semverhave been updated*LASTor*MAXare included (see #3131)cd libc-test && cargo test --target mytarget); especially relevant for platforms that may not be checked in CI@rustbot label +stable-nominated