← Back to Pull requests

Checked/wrapping/strict/unbounded funnel shifts #161119

Open
pthariensflame opened this pull request with 174 lines diff across 5 files
View on GitHub
pthariensflame pthariensflame commented on Aug 15, 2026 00:55 UTC
Author

<!-- homu-ignore:start -->
<!--
Please read our [LLM policy] before opening a PR,
If you used an LLM to generate any part of this PR, including the PR description, please disclose that according to our [guidelines][disclosure guidelines].
LLM contributions are not banned, but are held to a higher standard of review and correctness.

[LLM policy]: https://forge.rust-lang.org/policies/llm-usage.html
[disclosure guidelines]: https://rustc-dev-guide.rust-lang.org/llm-guidance/writing.html#disclosure-guidelines

If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

r? <reviewer name>

When merged, your PR's description becomes part of the commit message of a merge commit.
If you do not want certain parts of it (such as your LLM disclosure) to show up in the permanent git history,
surround them with a pair of HTML comments containing homu-ignore:start and homu-ignore:end.
-->
<!-- homu-ignore:end -->

This implements the wrapping funnel shifts requested at https://github.com/rust-lang/libs-team/issues/642#issuecomment-3231967424 and also some additional forms of funnel shift proposed at https://github.com/rust-lang/libs-team/issues/855; this might interact with rust-lang/rust#161015, which is attempting to stabilize the original funnel shift methods.

The work in this PR was done entirely by some people inside a human brain, without the use of any LLMs…or much use of an IDE since ours kept crashing during this process and we had to resort to a plain text editor. 😅

This implements the tracking issue rust-lang/rust#161798.

Diff: 174 lines (+164 / -10) across 5 files Reviewer: tgross35 Review duration: 160751m
All Vouch review confidence checks passed
Residual risk 0.07 = Change Risk (0.52) × (1 − Review Confidence (0.86)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 174 lines diff across 5 files
0.52
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.92 · 5 substantive comment(s)
0.92
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
85%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.309
Ai Authored ai_authored
0.050
Real PR Conversation Timeline
25 items
rustbot rustbot commented on Aug 15, 2026 00:56 UTC
Contributor

r? @JohnTitor

rustbot has assigned @JohnTitor.
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

<details>
<summary>Why was this reviewer chosen?</summary>

The reviewer was selected based on:

  • Owners of files modified in this PR: libs

  • libs expanded to 12 candidates

  • Random selection from JohnTitor, Mark-Simulacrum, clarfonthey, nia-e, tgross35
  • </details>

    tgross35 tgross35 commented on Aug 15, 2026 01:02 UTC
    Contributor
    tgross35 tgross35 commented on code on Aug 20, 2026 07:05 UTC
    Code Review
    library/core/src/num/uint_macros.rs:1
    @@ -611,11 +609,111 @@ macro_rules! uint_impl {
             #[must_use = "this returns the result of the operation, without modifying the original"]
             #[inline(always)]
             pub const fn funnel_shr(self, right: Self, n: u32) -> Self {
    -            assert!(n < Self::BITS, "attempt to funnel shift right with overflow");
    -            // SAFETY: just checked that `shift` is in-range
    +            self.checked_funnel_shr(right, n).expect("attempt to funnel shift right with overflow")
    +        }
    +
    +        /// Performs a left funnel shift.
    +        ///
    +        /// This function will return `None` if `n` is greater than or equal to the number of
    +        /// bits in `self`, i.e. when [`funnel_shl`](Self::funnel_shl) would panic.
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "none")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "none")]

    Please create a new tracking issue. I think it's fine to do even before the ACP is accepted

    View changes since the review

    pthariensflame pthariensflame commented on code on Aug 20, 2026 16:11 UTC
    Code Review
    library/core/src/num/uint_macros.rs:1
    @@ -611,11 +609,111 @@ macro_rules! uint_impl {
             #[must_use = "this returns the result of the operation, without modifying the original"]
             #[inline(always)]
             pub const fn funnel_shr(self, right: Self, n: u32) -> Self {
    -            assert!(n < Self::BITS, "attempt to funnel shift right with overflow");
    -            // SAFETY: just checked that `shift` is in-range
    +            self.checked_funnel_shr(right, n).expect("attempt to funnel shift right with overflow")
    +        }
    +
    +        /// Performs a left funnel shift.
    +        ///
    +        /// This function will return `None` if `n` is greater than or equal to the number of
    +        /// bits in `self`, i.e. when [`funnel_shl`](Self::funnel_shl) would panic.
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "none")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "none")]

    We will update this PR when we are next back at our computer on Monday for other reasons anyway (adding strict versions, adding tests), so we will make a tracking issue and list it then too.

    rust-bors[bot] rust-bors[bot] commented on Aug 25, 2026 09:07 UTC
    Bot

    :umbrella: The latest upstream changes (presumably #161719) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

    rustbot rustbot commented on Aug 26, 2026 03:57 UTC
    Contributor

    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 commented on code on Aug 27, 2026 20:35 UTC
    Code Review
    library/core/src/num/uint_macros.rs:1
    @@ -639,10 +636,141 @@ macro_rules! uint_impl {
                 if intrinsics::overflow_checks() {
                     assert!(n < Self::BITS, "attempt to funnel shift right with overflow");
                 }
    +
    +            self.wrapping_funnel_shr(right, n)
    +        }
    +
    +        /// Performs a left funnel shift.

    All of the summary lines say "Performs a left/right funnel shift." Please update these to be a bit more similar to the {checked,wrapping,strict,unbounded}_{shl,shr}.

    tgross35 tgross35 commented on code on Aug 27, 2026 20:35 UTC
    Code Review
    library/core/src/num/uint_macros.rs:1
    @@ -639,10 +636,141 @@ macro_rules! uint_impl {
                 if intrinsics::overflow_checks() {
                     assert!(n < Self::BITS, "attempt to funnel shift right with overflow");
                 }
    +
    +            self.wrapping_funnel_shr(right, n)
    +        }
    +
    +        /// Performs a left funnel shift.
    +        ///
    +        /// This function will return `None` if `n` is greater than or equal to the number of
    +        /// bits in `self`, i.e., when [`funnel_shl`](Self::funnel_shl) might panic or wrap.

    Please add examples

    tgross35 tgross35 commented on code on Aug 27, 2026 20:37 UTC
    Code Review
    library/core/src/num/uint_macros.rs:1
    @@ -639,10 +636,141 @@ macro_rules! uint_impl {
                 if intrinsics::overflow_checks() {
                     assert!(n < Self::BITS, "attempt to funnel shift right with overflow");
                 }
    +
    +            self.wrapping_funnel_shr(right, n)
    +        }
    +
    +        /// Performs a left funnel shift.
    +        ///
    +        /// This function will return `None` if `n` is greater than or equal to the number of
    +        /// bits in `self`, i.e., when [`funnel_shl`](Self::funnel_shl) might panic or wrap.

    Use "would" rather than "might" because we guarantee it would do one of those two things.

    tgross35 tgross35 commented on code on Aug 27, 2026 20:41 UTC
    Code Review
    library/core/src/num/uint_macros.rs:1
    @@ -639,10 +636,141 @@ macro_rules! uint_impl {
                 if intrinsics::overflow_checks() {
                     assert!(n < Self::BITS, "attempt to funnel shift right with overflow");
                 }
    +
    +            self.wrapping_funnel_shr(right, n)
    +        }
    +
    +        /// Performs a left funnel shift.
    +        ///
    +        /// This function will return `None` if `n` is greater than or equal to the number of
    +        /// bits in `self`, i.e., when [`funnel_shl`](Self::funnel_shl) might panic or wrap.
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[must_use = "this returns the result of the operation, without modifying the original"]
    +        #[inline(always)]
    +        pub const fn checked_funnel_shl(self, right: Self, n: u32) -> Option<Self> {
    +            if n < Self::BITS {
    +                // SAFETY: just checked that `n` is in-range
    +                Some(unsafe { self.unchecked_funnel_shl(right, n) })
    +            } else {
    +                None
    +            }
    +        }
    +
    +        /// Performs a right funnel shift.
    +        ///
    +        /// This function will return `None` if `n` is greater than or equal to the number of
    +        /// bits in `self`, i.e., when [`funnel_shr`](Self::funnel_shr) might panic or wrap.
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[must_use = "this returns the result of the operation, without modifying the original"]
    +        #[inline(always)]
    +        pub const fn checked_funnel_shr(self, right: Self, n: u32) -> Option<Self> {
    +            if n < Self::BITS {
    +                // SAFETY: just checked that `n` is in-range
    +                Some(unsafe { self.unchecked_funnel_shr(right, n) })
    +            } else {
    +                None
    +            }
    +        }
    +
    +        /// Performs a left funnel shift.
    +        ///
    +        /// This function shifts by `mask(n)`, where `mask` removes any high-order bits of `n`
    +        /// that would cause the shift to exceed the bitwidth of the type. As a result, this
    +        /// function never panics, unlike [`funnel_shl`](Self::funnel_shl).
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[must_use = "this returns the result of the operation, without modifying the original"]
    +        #[inline(always)]
    +        pub const fn wrapping_funnel_shl(self, right: Self, n: u32) -> Self {

    Include the "Beware that, unlike most other wrapping_* methods on integer" from wrapping_shl, adapted to funnel shifts. The result can be extra unintuitive because of the reason mentioned at https://github.com/rust-lang/libs-team/issues/642#issuecomment-3231967424, try to capture that in an example.

    (same for wrapping_funnel_shr)

    tgross35 tgross35 commented on code on Aug 27, 2026 20:42 UTC
    Code Review
    library/core/src/num/uint_macros.rs:1
    @@ -639,10 +636,141 @@ macro_rules! uint_impl {
                 if intrinsics::overflow_checks() {
                     assert!(n < Self::BITS, "attempt to funnel shift right with overflow");
                 }
    +
    +            self.wrapping_funnel_shr(right, n)
    +        }
    +
    +        /// Performs a left funnel shift.
    +        ///
    +        /// This function will return `None` if `n` is greater than or equal to the number of
    +        /// bits in `self`, i.e., when [`funnel_shl`](Self::funnel_shl) might panic or wrap.
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[must_use = "this returns the result of the operation, without modifying the original"]
    +        #[inline(always)]
    +        pub const fn checked_funnel_shl(self, right: Self, n: u32) -> Option<Self> {
    +            if n < Self::BITS {
    +                // SAFETY: just checked that `n` is in-range
    +                Some(unsafe { self.unchecked_funnel_shl(right, n) })
    +            } else {
    +                None
    +            }
    +        }
    +
    +        /// Performs a right funnel shift.
    +        ///
    +        /// This function will return `None` if `n` is greater than or equal to the number of
    +        /// bits in `self`, i.e., when [`funnel_shr`](Self::funnel_shr) might panic or wrap.
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[must_use = "this returns the result of the operation, without modifying the original"]
    +        #[inline(always)]
    +        pub const fn checked_funnel_shr(self, right: Self, n: u32) -> Option<Self> {
    +            if n < Self::BITS {
    +                // SAFETY: just checked that `n` is in-range
    +                Some(unsafe { self.unchecked_funnel_shr(right, n) })
    +            } else {
    +                None
    +            }
    +        }
    +
    +        /// Performs a left funnel shift.
    +        ///
    +        /// This function shifts by `mask(n)`, where `mask` removes any high-order bits of `n`
    +        /// that would cause the shift to exceed the bitwidth of the type. As a result, this
    +        /// function never panics, unlike [`funnel_shl`](Self::funnel_shl).
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[must_use = "this returns the result of the operation, without modifying the original"]
    +        #[inline(always)]
    +        pub const fn wrapping_funnel_shl(self, right: Self, n: u32) -> Self {
    +            let n = n & (Self::BITS - 1);
                 // SAFETY: `n` is wrapped to within range
    -            unsafe {
    -                let n = n & (Self::BITS - 1);
    -                self.unchecked_funnel_shr(right, n)
    +            unsafe { self.unchecked_funnel_shl(right, n) }
    +        }
    +
    +        /// Performs a right funnel shift.
    +        ///
    +        /// This function shifts by `mask(n)`, where `mask` removes any high-order bits of `n`
    +        /// that would cause the shift to exceed the bitwidth of the type. As a result, this
    +        /// function never panics, unlike [`funnel_shr`](Self::funnel_shr).
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[must_use = "this returns the result of the operation, without modifying the original"]
    +        #[inline(always)]
    +        pub const fn wrapping_funnel_shr(self, right: Self, n: u32) -> Self {
    +            let n = n & (Self::BITS - 1);
    +            // SAFETY: `n` is wrapped to within range
    +            unsafe { self.unchecked_funnel_shr(right, n) }
    +        }
    +
    +        /// Performs a left funnel shift.
    +        ///
    +        /// # Panics
    +        ///
    +        /// This function will always panic if `n` is greater than or equal to the number of
    +        /// bits in `self`, i.e., when [`funnel_shr`](Self::funnel_shr) might panic or wrap.
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[must_use = "this returns the result of the operation, without modifying the original"]
    +        #[inline(always)]
    +        pub const fn strict_funnel_shl(self, right: Self, n: u32) -> Self {
    +            assert!(n < Self::BITS, "attempt to funnel shift left with overflow");
    +            // SAFETY: `n` is checked to be within range
    +            unsafe { self.unchecked_funnel_shl(right, n) }
    +        }
    +
    +        /// Performs a right funnel shift.
    +        ///
    +        /// # Panics
    +        ///
    +        /// This function will always panic if `n` is greater than or equal to the number of
    +        /// bits in `self`, i.e., when [`funnel_shr`](Self::funnel_shr) might panic or wrap.
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[must_use = "this returns the result of the operation, without modifying the original"]
    +        #[inline(always)]
    +        pub const fn strict_funnel_shr(self, right: Self, n: u32) -> Self {

    The strict_* methods have a subsection "overflow behavior". I don't love that, but this should be consistent

    https://doc.rust-lang.org/nightly/std/primitive.u32.html#method.strict_shl

    tgross35 tgross35 commented on code on Aug 27, 2026 20:47 UTC
    Code Review
    library/core/src/num/uint_macros.rs:1
    @@ -639,10 +636,141 @@ macro_rules! uint_impl {
                 if intrinsics::overflow_checks() {
                     assert!(n < Self::BITS, "attempt to funnel shift right with overflow");
                 }
    +
    +            self.wrapping_funnel_shr(right, n)
    +        }
    +
    +        /// Performs a left funnel shift.
    +        ///
    +        /// This function will return `None` if `n` is greater than or equal to the number of
    +        /// bits in `self`, i.e., when [`funnel_shl`](Self::funnel_shl) might panic or wrap.
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[must_use = "this returns the result of the operation, without modifying the original"]
    +        #[inline(always)]
    +        pub const fn checked_funnel_shl(self, right: Self, n: u32) -> Option<Self> {
    +            if n < Self::BITS {
    +                // SAFETY: just checked that `n` is in-range
    +                Some(unsafe { self.unchecked_funnel_shl(right, n) })
    +            } else {
    +                None
    +            }
    +        }
    +
    +        /// Performs a right funnel shift.
    +        ///
    +        /// This function will return `None` if `n` is greater than or equal to the number of
    +        /// bits in `self`, i.e., when [`funnel_shr`](Self::funnel_shr) might panic or wrap.
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[must_use = "this returns the result of the operation, without modifying the original"]
    +        #[inline(always)]
    +        pub const fn checked_funnel_shr(self, right: Self, n: u32) -> Option<Self> {
    +            if n < Self::BITS {
    +                // SAFETY: just checked that `n` is in-range
    +                Some(unsafe { self.unchecked_funnel_shr(right, n) })
    +            } else {
    +                None
    +            }
    +        }
    +
    +        /// Performs a left funnel shift.
    +        ///
    +        /// This function shifts by `mask(n)`, where `mask` removes any high-order bits of `n`
    +        /// that would cause the shift to exceed the bitwidth of the type. As a result, this
    +        /// function never panics, unlike [`funnel_shl`](Self::funnel_shl).
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[must_use = "this returns the result of the operation, without modifying the original"]
    +        #[inline(always)]
    +        pub const fn wrapping_funnel_shl(self, right: Self, n: u32) -> Self {
    +            let n = n & (Self::BITS - 1);
                 // SAFETY: `n` is wrapped to within range
    -            unsafe {
    -                let n = n & (Self::BITS - 1);
    -                self.unchecked_funnel_shr(right, n)
    +            unsafe { self.unchecked_funnel_shl(right, n) }
    +        }
    +
    +        /// Performs a right funnel shift.
    +        ///
    +        /// This function shifts by `mask(n)`, where `mask` removes any high-order bits of `n`
    +        /// that would cause the shift to exceed the bitwidth of the type. As a result, this
    +        /// function never panics, unlike [`funnel_shr`](Self::funnel_shr).
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[must_use = "this returns the result of the operation, without modifying the original"]
    +        #[inline(always)]
    +        pub const fn wrapping_funnel_shr(self, right: Self, n: u32) -> Self {
    +            let n = n & (Self::BITS - 1);
    +            // SAFETY: `n` is wrapped to within range
    +            unsafe { self.unchecked_funnel_shr(right, n) }
    +        }
    +
    +        /// Performs a left funnel shift.
    +        ///
    +        /// # Panics
    +        ///
    +        /// This function will always panic if `n` is greater than or equal to the number of
    +        /// bits in `self`, i.e., when [`funnel_shr`](Self::funnel_shr) might panic or wrap.
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[must_use = "this returns the result of the operation, without modifying the original"]
    +        #[inline(always)]
    +        pub const fn strict_funnel_shl(self, right: Self, n: u32) -> Self {
    +            assert!(n < Self::BITS, "attempt to funnel shift left with overflow");
    +            // SAFETY: `n` is checked to be within range
    +            unsafe { self.unchecked_funnel_shl(right, n) }
    +        }
    +
    +        /// Performs a right funnel shift.
    +        ///
    +        /// # Panics
    +        ///
    +        /// This function will always panic if `n` is greater than or equal to the number of
    +        /// bits in `self`, i.e., when [`funnel_shr`](Self::funnel_shr) might panic or wrap.
    +        #[rustc_const_unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[unstable(feature = "wrapping_funnel_shifts", issue = "161798")]
    +        #[must_use = "this returns the result of the operation, without modifying the original"]
    +        #[inline(always)]
    +        pub const fn strict_funnel_shr(self, right: Self, n: u32) -> Self {
    +            assert!(n < Self::BITS, "attempt to funnel shift right with overflow");

    These should probably go in the overflow_panic module like the other strict_* functions to be consistent. Though I'm not really sure why that module exists.

    tgross35 tgross35 commented on code on Aug 27, 2026 20:49 UTC
    Code Review
    library/coretests/tests/num/uint_macros.rs:1
    @@ -241,6 +241,28 @@ macro_rules! uint_module {
                 let _ = <$T>::funnel_shr(A, B, $T::BITS);
             }
     
    +        #[test]
    +        #[should_panic = "attempt to funnel shift left with overflow"]
    +        fn test_strict_funnel_shl_overflow() {
    +            let _ = <$T>::strict_funnel_shl(A, B, $T::BITS);
    +        }
    +
    +        #[test]
    +        #[should_panic = "attempt to funnel shift right with overflow"]
    +        fn test_strict_funnel_shr_overflow() {
    +            let _ = <$T>::strict_funnel_shr(A, B, $T::BITS);
    +        }
    +
    +        #[test]
    +        fn test_wrapping_funnel_shl_overflow() {
    +            let _ = <$T>::wrapping_funnel_shl(A, B, $T::BITS);
    +        }
    +
    +        #[test]
    +        fn test_wrapping_funnel_shr_overflow() {
    +            let _ = <$T>::wrapping_funnel_shr(A, B, $T::BITS);
    +        }
    +

    These aren't actually testing anything other than the fact that we don't panic?

    These methods should be tested in test_funnel_shifts_runtime and test_funnel_shift

    tgross35 tgross35 requested changes on Aug 27, 2026 20:50 UTC
    Changes Requested Reviewer

    Implementations look alright but needs examples and tests.

    r? me

    View changes since this review

    rustbot rustbot commented on Aug 27, 2026 20:50 UTC
    Contributor

    Reminder, once the PR becomes ready for a review, use @rustbot ready.

    pthariensflame pthariensflame commented on Sep 02, 2026 20:00 UTC
    Author

    Apologies for the unannounced delay; we should get back to working on this in the next few days.

    rust-bors[bot] rust-bors[bot] commented on Sep 29, 2026 07:20 UTC
    Bot

    :umbrella: The latest upstream changes (presumably #163465) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

    tgross35 tgross35 commented on Oct 28, 2026 01:09 UTC
    Contributor

    @pthariensflame gentle ping :)

    pthariensflame pthariensflame commented on Oct 28, 2026 01:17 UTC
    Author

    @pthariensflame gentle ping :)

    @tgross35 Ping acknowledged gratefully; working our way back to this stuff now, hoping to get things done tomorrow even. ❤️

    tgross35 tgross35 commented on Oct 28, 2026 02:29 UTC
    Contributor

    No pressure! Just something that's close to done and would be nice to have.

    rustbot rustbot commented on Nov 01, 2026 05:28 UTC
    Contributor

    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.

    pthariensflame pthariensflame commented on Nov 01, 2026 05:31 UTC
    Author

    No pressure! Just something that's close to done and would be nice to have.

    Finally got around to doing the big rebase! None of your comments have been addressed yet, but we're now on the path to doing so shortly.

    rust-log-analyzer rust-log-analyzer commented on Nov 01, 2026 05:35 UTC
    Contributor

    The job test-x86_64-gnu-miri failed! Check out the build log: (web) (plain enhanced) (plain)

    <details><summary><i>Click to see the possible cause of the failure (guessed by this bot)</i></summary>

       |            ^^^^^^^^^^^^^
       |
       = note: `#[warn(stable_features)]` on by default
    
    error: const function that might be (indirectly) exposed to stable cannot use `#[feature(wrapping_funnel_shifts)]`
        --> library/core/src/num/uint_macros.rs:568:13
         |
       1 | / macro_rules! uint_impl {
       2 | |     (
       3 | |         Self = $SelfT:ty,
       4 | |         ActualT = $ActualT:ident,
    ...    |
     568 | |             self.wrapping_funnel_shl(right, n)
         | |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...    |
    4518 | | }
    ---
         |
         = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
    help: if the caller is not (yet) meant to be exposed to stable const contexts, add `#[rustc_const_unstable]`
         |
     563 +         #[rustc_const_unstable(feature = "...", issue = "...")]
     564 |         pub const fn funnel_shl(self, right: Self, n: u32) -> Self {
         |
    
    error: const function that might be (indirectly) exposed to stable cannot use `#[feature(wrapping_funnel_shifts)]`
        --> library/core/src/num/uint_macros.rs:632:13
         |
       1 | / macro_rules! uint_impl {
       2 | |     (
       3 | |         Self = $SelfT:ty,
       4 | |         ActualT = $ActualT:ident,
    ...    |
     632 | |             self.wrapping_funnel_shr(right, n)
         | |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...    |
    4518 | | }
    ---
         |
         = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
    help: if the caller is not (yet) meant to be exposed to stable const contexts, add `#[rustc_const_unstable]`
         |
     627 +         #[rustc_const_unstable(feature = "...", issue = "...")]
     628 |         pub const fn funnel_shr(self, right: Self, n: u32) -> Self {
         |
    
    error: const function that might be (indirectly) exposed to stable cannot use `#[feature(wrapping_funnel_shifts)]`
        --> library/core/src/num/uint_macros.rs:568:13
         |
       1 | / macro_rules! uint_impl {
       2 | |     (
       3 | |         Self = $SelfT:ty,
       4 | |         ActualT = $ActualT:ident,
    ...    |
     568 | |             self.wrapping_funnel_shl(right, n)
         | |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...    |
    4518 | | }
    ---
         |
         = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
    help: if the caller is not (yet) meant to be exposed to stable const contexts, add `#[rustc_const_unstable]`
         |
     563 +         #[rustc_const_unstable(feature = "...", issue = "...")]
     564 |         pub const fn funnel_shl(self, right: Self, n: u32) -> Self {
         |
    
    error: const function that might be (indirectly) exposed to stable cannot use `#[feature(wrapping_funnel_shifts)]`
        --> library/core/src/num/uint_macros.rs:632:13
         |
       1 | / macro_rules! uint_impl {
       2 | |     (
       3 | |         Self = $SelfT:ty,
       4 | |         ActualT = $ActualT:ident,
    ...    |
     632 | |             self.wrapping_funnel_shr(right, n)
         | |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...    |
    4518 | | }
    ---
         |
         = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
    help: if the caller is not (yet) meant to be exposed to stable const contexts, add `#[rustc_const_unstable]`
         |
     627 +         #[rustc_const_unstable(feature = "...", issue = "...")]
     628 |         pub const fn funnel_shr(self, right: Self, n: u32) -> Self {
         |
    
    error: const function that might be (indirectly) exposed to stable cannot use `#[feature(wrapping_funnel_shifts)]`
        --> library/core/src/num/uint_macros.rs:568:13
         |
       1 | / macro_rules! uint_impl {
       2 | |     (
       3 | |         Self = $SelfT:ty,
       4 | |         ActualT = $ActualT:ident,
    ...    |
     568 | |             self.wrapping_funnel_shl(right, n)
         | |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...    |
    4518 | | }
    ---
         |
         = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
    help: if the caller is not (yet) meant to be exposed to stable const contexts, add `#[rustc_const_unstable]`
         |
     563 +         #[rustc_const_unstable(feature = "...", issue = "...")]
     564 |         pub const fn funnel_shl(self, right: Self, n: u32) -> Self {
         |
    
    error: const function that might be (indirectly) exposed to stable cannot use `#[feature(wrapping_funnel_shifts)]`
        --> library/core/src/num/uint_macros.rs:632:13
         |
       1 | / macro_rules! uint_impl {
       2 | |     (
       3 | |         Self = $SelfT:ty,
       4 | |         ActualT = $ActualT:ident,
    ...    |
     632 | |             self.wrapping_funnel_shr(right, n)
         | |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...    |
    4518 | | }
    ---
         |
         = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
    help: if the caller is not (yet) meant to be exposed to stable const contexts, add `#[rustc_const_unstable]`
         |
     627 +         #[rustc_const_unstable(feature = "...", issue = "...")]
     628 |         pub const fn funnel_shr(self, right: Self, n: u32) -> Self {
         |
    
    error: const function that might be (indirectly) exposed to stable cannot use `#[feature(wrapping_funnel_shifts)]`
        --> library/core/src/num/uint_macros.rs:568:13
         |
       1 | / macro_rules! uint_impl {
       2 | |     (
       3 | |         Self = $SelfT:ty,
       4 | |         ActualT = $ActualT:ident,
    ...    |
     568 | |             self.wrapping_funnel_shl(right, n)
         | |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...    |
    4518 | | }
    ---
         |
         = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
    help: if the caller is not (yet) meant to be exposed to stable const contexts, add `#[rustc_const_unstable]`
         |
     563 +         #[rustc_const_unstable(feature = "...", issue = "...")]
     564 |         pub const fn funnel_shl(self, right: Self, n: u32) -> Self {
         |
    
    error: const function that might be (indirectly) exposed to stable cannot use `#[feature(wrapping_funnel_shifts)]`
        --> library/core/src/num/uint_macros.rs:632:13
         |
       1 | / macro_rules! uint_impl {
       2 | |     (
       3 | |         Self = $SelfT:ty,
       4 | |         ActualT = $ActualT:ident,
    ...    |
     632 | |             self.wrapping_funnel_shr(right, n)
         | |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...    |
    4518 | | }
    ---
         |
         = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
    help: if the caller is not (yet) meant to be exposed to stable const contexts, add `#[rustc_const_unstable]`
         |
     627 +         #[rustc_const_unstable(feature = "...", issue = "...")]
     628 |         pub const fn funnel_shr(self, right: Self, n: u32) -> Self {
         |
    
    error: const function that might be (indirectly) exposed to stable cannot use `#[feature(wrapping_funnel_shifts)]`
        --> library/core/src/num/uint_macros.rs:568:13
         |
       1 | / macro_rules! uint_impl {
       2 | |     (
       3 | |         Self = $SelfT:ty,
       4 | |         ActualT = $ActualT:ident,
    ...    |
     568 | |             self.wrapping_funnel_shl(right, n)
         | |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...    |
    4518 | | }
    ---
         |
         = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
    help: if the caller is not (yet) meant to be exposed to stable const contexts, add `#[rustc_const_unstable]`
         |
     563 +         #[rustc_const_unstable(feature = "...", issue = "...")]
     564 |         pub const fn funnel_shl(self, right: Self, n: u32) -> Self {
         |
    
    error: const function that might be (indirectly) exposed to stable cannot use `#[feature(wrapping_funnel_shifts)]`
        --> library/core/src/num/uint_macros.rs:632:13
         |
       1 | / macro_rules! uint_impl {
       2 | |     (
       3 | |         Self = $SelfT:ty,
       4 | |         ActualT = $ActualT:ident,
    ...    |
     632 | |             self.wrapping_funnel_shr(right, n)
         | |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...    |
    4518 | | }
    ---
         |
         = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
    help: if the caller is not (yet) meant to be exposed to stable const contexts, add `#[rustc_const_unstable]`
         |
     627 +         #[rustc_const_unstable(feature = "...", issue = "...")]
     628 |         pub const fn funnel_shr(self, right: Self, n: u32) -> Self {
         |
    
    error: const function that might be (indirectly) exposed to stable cannot use `#[feature(wrapping_funnel_shifts)]`
        --> library/core/src/num/uint_macros.rs:568:13
         |
       1 | / macro_rules! uint_impl {
       2 | |     (
       3 | |         Self = $SelfT:ty,
       4 | |         ActualT = $ActualT:ident,
    ...    |
     568 | |             self.wrapping_funnel_shl(right, n)
         | |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...    |
    4518 | | }
    ---
         |
         = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
    help: if the caller is not (yet) meant to be exposed to stable const contexts, add `#[rustc_const_unstable]`
         |
     563 +         #[rustc_const_unstable(feature = "...", issue = "...")]
     564 |         pub const fn funnel_shl(self, right: Self, n: u32) -> Self {
         |
    
    error: const function that might be (indirectly) exposed to stable cannot use `#[feature(wrapping_funnel_shifts)]`
        --> library/core/src/num/uint_macros.rs:632:13
         |
       1 | / macro_rules! uint_impl {
       2 | |     (
       3 | |         Self = $SelfT:ty,
       4 | |         ActualT = $ActualT:ident,
    ...    |
     632 | |             self.wrapping_funnel_shr(right, n)
         | |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...    |
    4518 | | }
    ---
         |
         = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
    help: if the caller is not (yet) meant to be exposed to stable const contexts, add `#[rustc_const_unstable]`
         |
     627 +         #[rustc_const_unstable(feature = "...", issue = "...")]
     628 |         pub const fn funnel_shr(self, right: Self, n: u32) -> Self {
         |
    
    [RUSTC-TIMING] core test:false 12.824
    error: `core` (lib) generated 1 warning
    error: could not compile `core` (lib) due to 12 previous errors; 1 warning emitted
    

    </details>

    rust-bors[bot] rust-bors[bot] commented on Nov 25, 2026 23:54 UTC
    Bot

    :umbrella: The latest upstream changes (presumably #166567) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

    Reviewers
    Assignees
    pthariensflame pthariensflame
    Labels
    risk: low confidence: 86.0% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 51.7% (MEDIUM) · Higher = larger blast radius
    51.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 86.0% · Lower = rushed or shallow review
    86.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 7.3% · Safe to merge
    7.3%
    Repository