Skip to content

stabilize unchecked_disjoint_bitor - #165009

Draft
malezjaa wants to merge 2 commits into
rust-lang:mainfrom
malezjaa:stabilize-disjoint-bitor
Draft

malezjaa wants to merge 2 commits into
rust-lang:mainfrom
malezjaa:stabilize-disjoint-bitor

Conversation

@malezjaa

Copy link
Copy Markdown
Contributor

Closes #135758

Public API:

impl u8/.../u128/usize/i8/.../i128/isize/bool {
    pub const unsafe fn unchecked_disjoint_bitor(self, other: Self) -> Self;
}

Implementation prs: #135760, #147368

Could we get a FCP started for this ^^?

r? @clarfonthey (since you've expressed interest in stabilization)

@rust-log-analyzer

This comment has been minimized.

@rustbot

rustbot commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

⚠️ #[rustc_allow_const_fn_unstable] needs careful audit to avoid accidentally exposing unstable
implementation details on stable.

cc @rust-lang/wg-const-eval

⚠️ #[rustc_intrinsic_const_stable_indirect] controls whether intrinsics can be exposed to stable const
code; adding it needs t-lang approval.

cc @rust-lang/wg-const-eval

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Oct 26, 2026
@tgross35

Copy link
Copy Markdown
Member

#147368 only merged a few days ago, those are trivial but we should still allow them to soak for at least a release cycle.

@malezjaa
malezjaa marked this pull request as draft October 27, 2026 06:46
@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 27, 2026
/// Otherwise it's immediate UB.
#[rustc_const_unstable(feature = "disjoint_bitor", issue = "135758")]
#[rustc_intrinsic_const_stable_indirect]
#[rustc_allow_const_fn_unstable(const_trait_impl, core_intrinsics_fallbacks)]

@RalfJung RalfJung Oct 27, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not great, it means we are not checking that the fallback impl actually only needs stable const stuff. Can we do without core_intrinsics_fallbacks?

Suggested change
#[rustc_allow_const_fn_unstable(const_trait_impl, core_intrinsics_fallbacks)]
#[rustc_allow_const_fn_unstable(const_trait_impl)]

View changes since the review

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Okay currently this does not work.

I am not comfortable stabilizing more intrinsics with trait-based fallback impls when we cannot actually do const stability checks in those fallback impls. So this is blocked on supporting #[rustc_const_stable_indirect] on traits.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cc discussion on funnel shifts: #161015 (comment)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To avoid blocking on const stability checking improvements, I'd suggest to make this PR only stabilize unchecked_disjoint_bitor for non-const callers.

@clarfonthey clarfonthey added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Oct 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-blocked Status: Blocked on something else such as an RFC or other implementation work. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking Issue for unchecked_disjoint_bitor

6 participants