Skip to content

Fix cc_bindings_from_rs build on nightly Rust after ConstExt removal. - #2329

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_999083269
Oct 14, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_999083269

Conversation

@copybara-service

Copy link
Copy Markdown

Fix cc_bindings_from_rs build on nightly Rust after ConstExt removal.

Upstream rust-lang/rust#163258 moved try_to_target_usize from the ConstExt
extension trait to an inherent method on Const, and removed ConstExt.
Gate use ty::consts::ConstExt; behind #[rustversion::before(2026-10-13)] so
that cc_bindings_from_rs compiles both on nightlies that had the temporary
ConstExt trait (2026-09-22 to 2026-10-12) and on newer nightlies
(2026-10-13+) as well as stable toolchains where try_to_target_usize is an
inherent method.

Upstream rust-lang/rust#163258 moved `try_to_target_usize` from the `ConstExt`
extension trait to an inherent method on `Const`, and removed `ConstExt`.
Gate `use ty::consts::ConstExt;` behind `#[rustversion::before(2026-10-13)]` so
that `cc_bindings_from_rs` compiles both on nightlies that had the temporary
`ConstExt` trait (2026-09-22 to 2026-10-12) and on newer nightlies
(2026-10-13+) as well as stable toolchains where `try_to_target_usize` is an
inherent method.

PiperOrigin-RevId: 999104756
@copybara-service
copybara-service Bot merged commit 7ac9e23 into main Oct 14, 2026
1 check passed
@copybara-service
copybara-service Bot deleted the test_999083269 branch October 14, 2026 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant