Uh oh!
There was an error while loading. Please reload this page.
num: Implement uint_gather_scatter_bits feature for unsigned integers - #149097
Conversation
rustbot
commented
Nov 19, 2025
rustbot has assigned @Mark-Simulacrum. Use |
Uh oh!
There was an error while loading. Please reload this page.
| #[unstable(feature = "uint_gather_scatter_bits", issue = "149069")] | ||
| #[must_use = "this returns the result of the operation, \ | ||
| without modifying the original"] | ||
| #[inline(always)] |
There was a problem hiding this comment.
| #[inline(always)] | |
| #[inline] |
This seems more appropriate for something with a nontrivial amount of code within. Comparable to wrapping_pow.
There was a problem hiding this comment.
Agree with this, and changed the function signatures to be mut param instead of redeclaring in the function body.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
73f838f to
275f191CompareImplement `gather_bits`, `scatter_bits` functions on unsigned integers Add tests to coretests
275f191 to
7f89192CompareMark-Simulacrum
commented
Nov 26, 2025
@bors r+ rollup |
bors
commented
Nov 26, 2025
…k-Simulacrum num: Implement `uint_gather_scatter_bits` feature for unsigned integers Feature gate: `#![feature(uint_gather_scatter_bits)]` Tracking issue: rust-lang#149069 Accepted ACP: rust-lang/libs-team#695 (comment) Implement `gather_bits`, `scatter_bits` functions on unsigned integers Add tests to coretests This implementation is a small improvement over the plain naive form (see the [solution sketch](rust-lang/libs-team#695)). We only check the set bits in the mask instead of iterating over every bit.
…k-Simulacrum num: Implement `uint_gather_scatter_bits` feature for unsigned integers Feature gate: `#![feature(uint_gather_scatter_bits)]` Tracking issue: rust-lang#149069 Accepted ACP: rust-lang/libs-team#695 (comment) Implement `gather_bits`, `scatter_bits` functions on unsigned integers Add tests to coretests This implementation is a small improvement over the plain naive form (see the [solution sketch](rust-lang/libs-team#695)). We only check the set bits in the mask instead of iterating over every bit.
…k-Simulacrum num: Implement `uint_gather_scatter_bits` feature for unsigned integers Feature gate: `#![feature(uint_gather_scatter_bits)]` Tracking issue: rust-lang#149069 Accepted ACP: rust-lang/libs-team#695 (comment) Implement `gather_bits`, `scatter_bits` functions on unsigned integers Add tests to coretests This implementation is a small improvement over the plain naive form (see the [solution sketch](rust-lang/libs-team#695)). We only check the set bits in the mask instead of iterating over every bit.
Rollup of 19 pull requests Successful merges: - #148048 (Stabilize `maybe_uninit_write_slice`) - #148641 (Add a diagnostic attribute for special casing const bound errors for non-const impls) - #148765 (std: split up the `thread` module) - #149074 (Add Command::get_env_clear) - #149097 (num: Implement `uint_gather_scatter_bits` feature for unsigned integers) - #149131 (optimize `slice::Iter::next_chunk`) - #149190 (Forbid `CHECK: br` and `CHECK-NOT: br` in codegen tests (suggest `br {{.*}}` instead)) - #149239 (clarify float min/max behavios for NaNs and signed zeros) - #149243 (Fix typo and clarify bootstrap change tracker entry) - #149270 (implement `Iterator::{exactly_one, collect_array}`) - #149295 (Suggest _bytes versions of endian-converting methods) - #149301 (Motor OS: make decode_error_kind more comprehensive) - #149306 (bootstrap: Miri now handles jemalloc like everything else) - #149325 (rustdoc: add regression test for #140968) - #149332 (fix rustdoc search says “Consider searching for "null" instead.” #149324) - #149349 (Fix typo in comment.) - #149353 (Tidying up UI tests [3/N]) - #149355 (Document that `build.description` affects symbol mangling and crate IDs) - #149360 (Enable CI download for windows-gnullvm) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 12 pull requests Successful merges: - #147115 (More robust stack protector testing) - #148048 (Stabilize `maybe_uninit_write_slice`) - #148641 (Add a diagnostic attribute for special casing const bound errors for non-const impls) - #149074 (Add Command::get_env_clear) - #149097 (num: Implement `uint_gather_scatter_bits` feature for unsigned integers) - #149131 (optimize `slice::Iter::next_chunk`) - #149190 (Forbid `CHECK: br` and `CHECK-NOT: br` in codegen tests (suggest `br {{.*}}` instead)) - #149239 (clarify float min/max behavios for NaNs and signed zeros) - #149243 (Fix typo and clarify bootstrap change tracker entry) - #149301 (Motor OS: make decode_error_kind more comprehensive) - #149306 (bootstrap: Miri now handles jemalloc like everything else) - #149325 (rustdoc: add regression test for #140968) r? `@ghost` `@rustbot` modify labels: rollup
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #149097 - okaneco:gather_scatter_bits, r=Mark-Simulacrum num: Implement `uint_gather_scatter_bits` feature for unsigned integers Feature gate: `#![feature(uint_gather_scatter_bits)]` Tracking issue: #149069 Accepted ACP: rust-lang/libs-team#695 (comment) Implement `gather_bits`, `scatter_bits` functions on unsigned integers Add tests to coretests This implementation is a small improvement over the plain naive form (see the [solution sketch](rust-lang/libs-team#695)). We only check the set bits in the mask instead of iterating over every bit.
…k-Simulacrum num: Implement `uint_gather_scatter_bits` feature for unsigned integers Feature gate: `#![feature(uint_gather_scatter_bits)]` Tracking issue: rust-lang#149069 Accepted ACP: rust-lang/libs-team#695 (comment) Implement `gather_bits`, `scatter_bits` functions on unsigned integers Add tests to coretests This implementation is a small improvement over the plain naive form (see the [solution sketch](rust-lang/libs-team#695)). We only check the set bits in the mask instead of iterating over every bit.
Feature gate:
#![feature(uint_gather_scatter_bits)]Tracking issue: #149069
Accepted ACP: rust-lang/libs-team#695 (comment)
Implement
gather_bits,scatter_bitsfunctions on unsigned integersAdd tests to coretests
This implementation is a small improvement over the plain naive form (see the solution sketch).
We only check the set bits in the mask instead of iterating over every bit.