Skip to content

implement const_binary_search#159528

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Lars-Schumann:const-binary-search
Jul 19, 2026
Merged

implement const_binary_search#159528
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Lars-Schumann:const-binary-search

Conversation

@Lars-Schumann

@Lars-Schumann Lars-Schumann commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

tracking issue: #159532

This makes unstably const the following public api:
core::slice::binary_search
core::slice::binary_search_by
core::slice::binary_search_by_key
core::slice::partition_point

Happy to make a tracking issue if these are acceptable.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 18, 2026
@rustbot

rustbot commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

r? @clarfonthey

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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 12 candidates
  • Random selection from 6 candidates

@clarfonthey

Copy link
Copy Markdown
Contributor

Yeah, I have wanted these for a while but forgot that we finally have const closures and can easily do this. Please create a tracking issue and update the code, and then I'm happy to merge.

@Lars-Schumann

Lars-Schumann commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

I opened the tracking issue and put it into the stability attributes.

@clarfonthey

Copy link
Copy Markdown
Contributor

@bors r+ rollup

Thank you!

@rust-bors

rust-bors Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2297b97 has been approved by clarfonthey

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 18, 2026
rust-bors Bot pushed a commit that referenced this pull request Jul 18, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #159517 (stdarch subtree update)
 - #159010 (Simplify the unwind crate)
 - #156650 (Stop using prefix_tys)
 - #159152 (triagebot: cc miri on any special-casing of miri in the standard library)
 - #159522 (Apply `#[diagnostic::opaque]` to macros expanding to built-in syntax)
 - #159528 (implement `const_binary_search`)
@rust-bors
rust-bors Bot merged commit 004392e into rust-lang:main Jul 19, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 19, 2026
rust-timer added a commit that referenced this pull request Jul 19, 2026
Rollup merge of #159528 - Lars-Schumann:const-binary-search, r=clarfonthey

implement `const_binary_search`

tracking issue: #159532

This makes unstably `const` the following public api:
`core::slice::binary_search`
`core::slice::binary_search_by`
`core::slice::binary_search_by_key`
`core::slice::partition_point`

Happy to make a tracking issue if these are acceptable.
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Jul 19, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#159517 (stdarch subtree update)
 - rust-lang/rust#159010 (Simplify the unwind crate)
 - rust-lang/rust#156650 (Stop using prefix_tys)
 - rust-lang/rust#159152 (triagebot: cc miri on any special-casing of miri in the standard library)
 - rust-lang/rust#159522 (Apply `#[diagnostic::opaque]` to macros expanding to built-in syntax)
 - rust-lang/rust#159528 (implement `const_binary_search`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

3 participants