Skip to content

Deprecate __int128, __uint128, __int128_t, __uint128#4343

Merged
tgross35 merged 1 commit intorust-lang:mainfrom
sanstzu:issues/4340
Mar 14, 2026
Merged

Deprecate __int128, __uint128, __int128_t, __uint128#4343
tgross35 merged 1 commit intorust-lang:mainfrom
sanstzu:issues/4340

Conversation

@sanstzu
Copy link
Contributor

@sanstzu sanstzu commented Mar 19, 2025

Description

Deprecates __int128, __uint128, __int128_t, __uint128_t and replace them with u128/i128 types, as per (#4340)

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
Collaborator

rustbot commented Mar 19, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot
Copy link
Collaborator

rustbot commented Mar 19, 2025

Some changes occurred in the Android module

cc @maurer

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you set the version to 0.2.172? We can backport the deprecation, 1.0 will just have the removal. You can also add back the changes to use i128/u128 internally, that is a non-breaking change.

Those two things and a squash, then lgtm!

@rustbot label +stable-nominated

@rustbot rustbot added stable-nominated This PR should be considered for cherry-pick to libc's stable release branch S-waiting-on-author and removed S-waiting-on-review labels Mar 22, 2025
@sanstzu
Copy link
Contributor Author

sanstzu commented Mar 22, 2025

Could you set the version to 0.2.172? We can backport the deprecation, 1.0 will just have the removal. You can also add back the changes to use i128/u128 internally, that is a non-breaking change.

Those two things and a squash, then lgtm!

@rustbot label +stable-nominated

Thanks for the review Trevor! Squashed my commits already.

@tgross35
Copy link
Contributor

Ctest is being silly again... these fields might just need to be skipped in libc-test. I'll take a closer look

@tgross35
Copy link
Contributor

Okay I might have an idea here, could you play around with setting a .typ_name override for the types that are failing? Something like

libc/libc-test/build.rs

Lines 706 to 725 in 8c10293

cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
"FILE" | "DIR" | "Dl_info" | "fd_set" => ty.to_string(),
"Ioctl" => "int".to_string(),
t if is_union => format!("union {t}"),
t if t.ends_with("_t") => t.to_string(),
// sigval is a struct in Rust, but a union in C:
"sigval" => "union sigval".to_string(),
// put `struct` in front of all structs:.
t if is_struct => format!("struct {t}"),
t => t.to_string(),
}
});
, the config for Linux and Android will need to be updated.

@sanstzu
Copy link
Contributor Author

sanstzu commented May 6, 2025

Okay I might have an idea here, could you play around with setting a .typ_name override for the types that are failing? Something like

libc/libc-test/build.rs

Lines 706 to 725 in 8c10293

cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
"FILE" | "DIR" | "Dl_info" | "fd_set" => ty.to_string(),
"Ioctl" => "int".to_string(),
t if is_union => format!("union {t}"),
t if t.ends_with("_t") => t.to_string(),
// sigval is a struct in Rust, but a union in C:
"sigval" => "union sigval".to_string(),
// put `struct` in front of all structs:.
t if is_struct => format!("struct {t}"),
t => t.to_string(),
}
});

, the config for Linux and Android will need to be updated.

Okay I might have an idea here, could you play around with setting a .typ_name override for the types that are failing? Something like

libc/libc-test/build.rs

Lines 706 to 725 in 8c10293

cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
"FILE" | "DIR" | "Dl_info" | "fd_set" => ty.to_string(),
"Ioctl" => "int".to_string(),
t if is_union => format!("union {t}"),
t if t.ends_with("_t") => t.to_string(),
// sigval is a struct in Rust, but a union in C:
"sigval" => "union sigval".to_string(),
// put `struct` in front of all structs:.
t if is_struct => format!("struct {t}"),
t => t.to_string(),
}
});

, the config for Linux and Android will need to be updated.

Sorry for the slow reply, wasn't on GitHub for the past few days and will work on it soon!

@rustbot rustbot added A-CI Area: CI-related items ctest Issues relating to the ctest crate O-arm O-illumos O-linux-like labels May 16, 2025
@rustbot
Copy link
Collaborator

rustbot commented May 16, 2025

Some changes occurred in solarish module

cc @jclulow, @pfmooney

Some changes occurred in OpenBSD module

cc @semarie

@sanstzu sanstzu force-pushed the issues/4340 branch 2 times, most recently from 41b762d to 6b23c64 Compare May 16, 2025 21:13
@tgross35
Copy link
Contributor

@sanstzu we now have the updated ctest so things should be less broken. Would you be able to rebase?

@sanstzu
Copy link
Contributor Author

sanstzu commented Sep 23, 2025

@sanstzu we now have the updated ctest so things should be less broken. Would you be able to rebase?

Will do, thanks!

@tgross35
Copy link
Contributor

tgross35 commented Dec 2, 2025

@sanstzu another gentle ping here :)

@rustbot

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Mar 14, 2026

Some changes occurred in an Android module

cc @maurer

@rustbot

This comment has been minimized.

@tgross35 tgross35 force-pushed the issues/4340 branch 2 times, most recently from 4c0ad10 to 2315dfd Compare March 14, 2026 07:45
@tgross35 tgross35 enabled auto-merge March 14, 2026 08:40
@rustbot

This comment has been minimized.

@tgross35
Copy link
Contributor

tgross35 commented Mar 14, 2026

I've commandeered this patch since we'd like to have it done (you are still listed as an author). Thank you for getting this started!

Rust's `i128` and `u128` are now documented to be compatible with the
types, so there is no reason to have the aliases.

Co-authored-by: Clayton Fernalo <claytonfernalo@gmail.com>
@rustbot
Copy link
Collaborator

rustbot commented Mar 14, 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.

@tgross35 tgross35 dismissed their stale review March 14, 2026 09:22

dismiss

@tgross35 tgross35 added this pull request to the merge queue Mar 14, 2026
Merged via the queue into rust-lang:main with commit 1212765 Mar 14, 2026
51 checks passed
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.

3 participants