Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite binary search implementation #128254

Merged
merged 1 commit into from
Aug 2, 2024
Merged

Conversation

Amanieu
Copy link
Member

@Amanieu Amanieu commented Jul 26, 2024

This PR builds on top of #128250, which should be merged first.

This restores the original binary search implementation from #45333 which has the nice property of having a loop count that only depends on the size of the slice. This, along with explicit conditional moves from #128250, means that the entire binary search loop can be perfectly predicted by the branch predictor.

Additionally, LLVM is able to unroll the loop when the slice length is known at compile-time. This results in a very compact code sequence of 3-4 instructions per binary search step and zero branches.

Fixes #53823
Fixes #115271

@rustbot
Copy link
Collaborator

rustbot commented Jul 26, 2024

r? @tgross35

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 26, 2024
@Amanieu
Copy link
Member Author

Amanieu commented Jul 26, 2024

Benchmarks

AMD Ryzen 9 3950X

Old

test binary_search_l1              ... bench:          28.09 ns/iter (+/- 0.74)
test binary_search_l1_with_dups    ... bench:          18.12 ns/iter (+/- 0.35)
test binary_search_l1_worst_case   ... bench:          14.19 ns/iter (+/- 1.14)
test binary_search_l2              ... bench:          40.88 ns/iter (+/- 1.11)
test binary_search_l2_with_dups    ... bench:          27.79 ns/iter (+/- 0.70)
test binary_search_l2_worst_case   ... bench:          25.57 ns/iter (+/- 0.83)
test binary_search_l3              ... bench:         109.16 ns/iter (+/- 1.25)
test binary_search_l3_with_dups    ... bench:          70.63 ns/iter (+/- 4.93)
test binary_search_l3_worst_case   ... bench:          44.09 ns/iter (+/- 0.74)

New

test binary_search_l1              ... bench:          11.87 ns/iter (+/- 0.98)
test binary_search_l1_with_dups    ... bench:          11.73 ns/iter (+/- 0.47)
test binary_search_l1_worst_case   ... bench:           9.80 ns/iter (+/- 0.22)
test binary_search_l2              ... bench:          18.23 ns/iter (+/- 3.47)
test binary_search_l2_with_dups    ... bench:          17.57 ns/iter (+/- 1.12)
test binary_search_l2_worst_case   ... bench:          14.70 ns/iter (+/- 1.17)
test binary_search_l3              ... bench:          61.18 ns/iter (+/- 1.63)
test binary_search_l3_with_dups    ... bench:          61.67 ns/iter (+/- 2.21)
test binary_search_l3_worst_case   ... bench:          24.73 ns/iter (+/- 0.64)

ARM Cortex-A72

Old

test binary_search_l1              ... bench:          69.01 ns/iter (+/- 0.19)
test binary_search_l1_with_dups    ... bench:          42.80 ns/iter (+/- 0.13)
test binary_search_l1_worst_case   ... bench:          41.70 ns/iter (+/- 1.32)
test binary_search_l2              ... bench:         108.10 ns/iter (+/- 0.66)
test binary_search_l2_with_dups    ... bench:          68.70 ns/iter (+/- 0.22)
test binary_search_l2_worst_case   ... bench:          67.60 ns/iter (+/- 0.14)
test binary_search_l3              ... bench:         807.14 ns/iter (+/- 19.50)
test binary_search_l3_with_dups    ... bench:         491.36 ns/iter (+/- 7.95)
test binary_search_l3_worst_case   ... bench:         137.74 ns/iter (+/- 0.37)

New

test binary_search_l1              ... bench:          44.36 ns/iter (+/- 0.10)
test binary_search_l1_with_dups    ... bench:          44.41 ns/iter (+/- 0.07)
test binary_search_l1_worst_case   ... bench:          32.33 ns/iter (+/- 0.02)
test binary_search_l2              ... bench:          75.38 ns/iter (+/- 0.22)
test binary_search_l2_with_dups    ... bench:          74.90 ns/iter (+/- 0.33)
test binary_search_l2_worst_case   ... bench:          50.03 ns/iter (+/- 0.14)
test binary_search_l3              ... bench:         742.06 ns/iter (+/- 26.84)
test binary_search_l3_with_dups    ... bench:         742.38 ns/iter (+/- 9.52)
test binary_search_l3_worst_case   ... bench:          76.37 ns/iter (+/- 0.10)

@Amanieu Amanieu marked this pull request as draft July 26, 2024 23:15
@rust-log-analyzer

This comment has been minimized.

@Amanieu Amanieu force-pushed the orig-binary-search branch 2 times, most recently from 7751cfe to 21ee157 Compare July 27, 2024 16:35
@tgross35
Copy link
Contributor

The result change for equal values seems fine to me, considering docs explicitly allow it. We could also consider special-casing on T::IS_ZST either to ensure those results do not change, or to provide an algorithm-agnostic deterministic output like #127007.

I think this is easily justified by the performance wins. However, since it does change user-visible stable behavior, it seems reasonable to get group consensus or decide if crater results are wanted first (as suggested at

#[test]
// Test implementation specific behavior when finding equivalent elements.
// It is ok to break this test but when you do a crater run is highly advisable.
fn test_binary_search_implementation_details() {
let b = [1, 1, 2, 2, 3, 3, 3];
assert_eq!(b.binary_search(&1), Ok(1));
assert_eq!(b.binary_search(&2), Ok(3));
assert_eq!(b.binary_search(&3), Ok(6));
let b = [1, 1, 1, 1, 1, 3, 3, 3, 3];
assert_eq!(b.binary_search(&1), Ok(4));
assert_eq!(b.binary_search(&3), Ok(8));
let b = [1, 1, 1, 1, 3, 3, 3, 3, 3];
assert_eq!(b.binary_search(&1), Ok(3));
assert_eq!(b.binary_search(&3), Ok(8));
}
).

@rustbot label +I-libs-nominated

r=me for the actual implementation change after the above is addressed in some way, and a rebase once #128250 merges.

@rustbot rustbot added the I-libs-nominated Nominated for discussion during a libs team meeting. label Jul 27, 2024
@Amanieu Amanieu force-pushed the orig-binary-search branch from 21ee157 to f3a8465 Compare July 27, 2024 22:28
@Amanieu
Copy link
Member Author

Amanieu commented Jul 28, 2024

I don't think it is worth special casing ZSTs since realistically nobody is ever going to sort a ZST slice. As long as we're still generating correct results for ZSTs, I would just ignore them.

@bors
Copy link
Contributor

bors commented Jul 29, 2024

☔ The latest upstream changes (presumably #125443) made this pull request unmergeable. Please resolve the merge conflicts.

@joboet
Copy link
Member

joboet commented Jul 29, 2024

I'd like to mention @scandum's collection of binary search algorithms, the current version in this PR is identical to the "monobound binary search". But maybe it'd be worth switching to the "tripple-tapped" variant instead?

@Amanieu
Copy link
Member Author

Amanieu commented Jul 29, 2024

The problem with the triple-tapped variant is that the number of iterations in the second loop is data-dependent. One of the main reasons the current algorithm is so fast is that it achieves perfect branch prediction no matter which key is being searched for.

@Amanieu Amanieu added I-libs-api-nominated Nominated for discussion during a libs-api team meeting. and removed I-libs-nominated Nominated for discussion during a libs team meeting. labels Jul 30, 2024
This restores the original binary search implementation from rust-lang#45333
which has the nice property of having a loop count that only depends on
the size of the slice. This, along with explicit conditional moves
from rust-lang#128250, means that the entire binary search loop can be perfectly
predicted by the branch predictor.

Additionally, LLVM is able to unroll the loop when the slice length is
known at compile-time. This results in a very compact code sequence of
3-4 instructions per binary search step and zero branches.

Fixes rust-lang#53823
@Amanieu Amanieu force-pushed the orig-binary-search branch from f3a8465 to bb58488 Compare July 30, 2024 16:10
@Amanieu Amanieu removed the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Jul 30, 2024
@Amanieu
Copy link
Member Author

Amanieu commented Jul 30, 2024

@bors try

@bors
Copy link
Contributor

bors commented Jul 30, 2024

📌 Commit bb58488 has been approved by tgross35

It is now in the queue for this repository.

@bors bors 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-crater Status: Waiting on a crater run to be completed. labels Jul 30, 2024
@scottmcm
Copy link
Member

Big fan of going back to an implementation that can fully-unroll. That's really helpful for doing lookups in static tables 👍

@bors
Copy link
Contributor

bors commented Aug 2, 2024

⌛ Testing commit bb58488 with merge 1932602...

@bors
Copy link
Contributor

bors commented Aug 2, 2024

☀️ Test successful - checks-actions
Approved by: tgross35
Pushing 1932602 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 2, 2024
@bors bors merged commit 1932602 into rust-lang:master Aug 2, 2024
7 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 2, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1932602): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.5% [0.2%, 1.7%] 16
Regressions ❌
(secondary)
6.2% [0.2%, 19.5%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.1% [-4.1%, -4.1%] 1
All ❌✅ (primary) 0.5% [0.2%, 1.7%] 16

Max RSS (memory usage)

Results (primary 3.6%, secondary 2.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.6% [3.6%, 3.6%] 1
Regressions ❌
(secondary)
2.4% [2.4%, 2.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.6% [3.6%, 3.6%] 1

Cycles

Results (primary 1.7%, secondary 0.9%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.7% [1.3%, 2.1%] 3
Regressions ❌
(secondary)
11.1% [10.3%, 12.0%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.2% [-4.9%, -1.1%] 5
All ❌✅ (primary) 1.7% [1.3%, 2.1%] 3

Binary size

Results (primary 0.1%, secondary 0.5%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.3%] 29
Regressions ❌
(secondary)
0.5% [0.1%, 2.9%] 42
Improvements ✅
(primary)
-0.8% [-0.8%, -0.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-0.8%, 0.3%] 30

Bootstrap: 758.912s -> 755.218s (-0.49%)
Artifact size: 336.84 MiB -> 336.77 MiB (-0.02%)

@Kobzol
Copy link
Contributor

Kobzol commented Aug 6, 2024

This is an optimization of the binary search algorithm, which should make runtime faster. The regression seems to be caused by LLVM spending more time in optimizing the binary search (since it is now more amenable to optimization and unrolling).

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Aug 6, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 6, 2024
rustc_errors: use perfect hashing for character replacements

The correctness of code in rust-lang#128200 relies on an array being sorted (so that it can be used in binary search later), which is currently enforced with `// tidy-alphabetical` (and characters being written in `\u{XXXX}` form), as well as lack of duplicate entries with conflicting keys, which is not currently enforced.

A const assert or a test can be added checking that (implemented in rust-lang#128465).

But this PR tries to use [perfect hashing](https://en.wikipedia.org/wiki/Perfect_hash_function) instead.

The performance implications are unclear. Asymptotically it's faster, but in reality we should just benchmark. Plus if there are no significant performance wins, this entire things is probably not even worse the additional dependencies it brings.

UPD: funnily enough, there's a PR optimizing the binary search implementation (rust-lang#128254) in the queue right now. So I guess we have to wait until that is merged too before benchmarking this.
@craterbot
Copy link
Collaborator

🚧 Experiment pr-128254 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-128254 is completed!
📊 318 regressed and 134 fixed (487456 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 9, 2024
@Amanieu
Copy link
Member Author

Amanieu commented Aug 9, 2024

@rust-lang/release

Refer to these crater results when evaluating the beta crater run: these are crates whose tests depends on implementation details of binary_search when there are multiple matching elements. This PR changed the exact index that is returned in such cases, which is allowed by the documentation of binary_search.

carolynzech added a commit to model-checking/verify-rust-std that referenced this pull request Aug 15, 2024
9cc3bc6 custom MIR: add support for tail calls
5674d1c Auto merge of rust-lang#128673 - matthiaskrgr:rollup-gtvpkm7, r=matthiaskrgr
deb1d75 Rollup merge of rust-lang#128619 - glandium:last_chunk, r=scottmcm
6449537 Rollup merge of rust-lang#128609 - swenson:smaller-faster-dragon, r=Amanieu
acb2c30 Rollup merge of rust-lang#128026 - devnexen:available_parallelism_vxworks, r=Mark-Simulacrum
89fe6df Rollup merge of rust-lang#128309 - kmicklas:btreeset-cursor, r=Amanieu
313484b Correct the const stabilization of `<[T]>::last_chunk`
22e026b Auto merge of rust-lang#128534 - bjorn3:split_stdlib_workspace, r=Mark-Simulacrum
1813603 Rollup merge of rust-lang#128526 - tshepang:patch-1, r=Amanieu
e8a1a41 Auto merge of rust-lang#128466 - sayantn:stdarch-update, r=tgross35
2adf9da Update stdarch
dc85bdb Chore: add `x86_amx_intrinsics` feature flag to `core/lib.rs` and remove `issue-120720-reduce-nan.rs`
e88b04d Rollup merge of rust-lang#128551 - Konippi:refactor-backtrace-style-in-panic, r=tgross35
43a1e93 Rollup merge of rust-lang#128530 - scottmcm:repeat-n-unchecked, r=joboet
47df194 Remove unnecessary constants from flt2dec dragon
0b5f1b8 Auto merge of rust-lang#128404 - compiler-errors:revert-dead-code-changes, r=pnkfelix
35cd95f Suppress new false-negatives that were masked by dead code analysis changes
9eb9fa6 Revert "Rollup merge of rust-lang#127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix"
975dc19 Rollup merge of rust-lang#128368 - nnethercote:rustfmt-tweaks, r=cuviper
0ee09fe Rollup merge of rust-lang#128303 - NobodyXu:specialise-for-pipe, r=cuviper
1967a12 Rollup merge of rust-lang#127586 - zachs18:more-must-use, r=cuviper
fc53324 Rollup merge of rust-lang#126704 - sayantn:sha, r=Amanieu
74dd96f chore: refactor backtrace style in panic
0e4358d Auto merge of rust-lang#128528 - workingjubilee:you-dont-need-to-see-this-cpuid-move-along, r=Amanieu
9fa74ab Move the standard library to a separate workspace
e13d132 Auto merge of rust-lang#128254 - Amanieu:orig-binary-search, r=tgross35
05d8d7c Implement `UncheckedIterator` directly for `RepeatN`
a5fa13e Rollup merge of rust-lang#128491 - c410-f3r:unlock-rfc-2011, r=workingjubilee
28e4d22 Rollup merge of rust-lang#128453 - RalfJung:raw_eq, r=saethlin
db770c6 std: Remove has_cpuid
39aad04 time.rs: remove "Basic usage text"
7df583c Dogfood
cb11051 Add the `sha512`, `sm3` and `sm4` target features
86ea79f Fix mutability in doc tests for `BTreeSet` cursors
c7be27f Introduce `Cursor`/`CursorMut`/`CursorMutKey` thrichotomy for `BTreeSet` like map API
8835b0f Fix some uses of "map" instead of "set" in `BTreeSet` cursor API docs
07f64a8 Share `UnorderedKeyError` with `BTReeMap` for set API
f859e54 Rollup merge of rust-lang#128499 - Konippi:refactor-backtrace-formatting, r=tgross35
fb966d2 Rollup merge of rust-lang#128497 - Bryanskiy:fix-dropck-doc, r=lcnr
ab00ae6 Rollup merge of rust-lang#128433 - hermit-os:hermit-unsafe_op_in_unsafe_fn, r=joboet
2614bd2 chore: refactor backtrace formatting
a8a4659 fix dropck documentation for `[T;0]` special-case
589c0a0 fix(os/hermit): `deny(unsafe_op_in_unsafe_fn)`
0260e47 fix(pal/hermit): `deny(unsafe_op_in_unsafe_fn)`
7bd6b11 refactor(pal/hermit): make `ENV` a non-mutable static
32894e2 Rollup merge of rust-lang#128416 - maurer:remove-android-hack, r=tgross35
beb76c3 Auto merge of rust-lang#128461 - matthiaskrgr:rollup-3dpp11g, r=matthiaskrgr
1e3976b Rollup merge of rust-lang#128162 - ChrisDenton:cleanup, r=joboet
cde45b0 Rollup merge of rust-lang#127567 - joboet:once_wait, r=Amanieu
0607642 Fix docs for OnceLock::get_mut_or_init
da48417 raw_eq: using it on bytes with provenance is not UB (outside const-eval)
cc6f37f std: fix busy-waiting in `Once::wait_force`, add more tests
6fd82f1 std: implement the `once_wait` feature
0c56873 Remove unneeded `pub(crate)`
787a1f7 Rollup merge of rust-lang#128388 - beetrees:f16-f128-slightly-improve-windows-abi, r=tgross35
e3a4ed3 Rollup merge of rust-lang#128387 - liigo:patch-14, r=tgross35
8b7f4ee refactor(pal/hermit): use default impl of `GlobalAlloc::alloc_zeroed`
c337019 refactor(pal/hermit): return `!` to satisfy rust-analyzer
7aafdcf android: Remove libstd hacks for unsupported Android APIs
ba65c6c Move Windows implementation of anon pipe
176508c Match LLVM ABI in `extern "C"` functions for `f128` on Windows
85e4ba0 Cleanup sys module to match house style
ddff2b6 Auto merge of rust-lang#128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68
e4b0e6d Rewrite binary search implementation
556dc60 More detailed note to deprecate ONCE_INIT
440ec83 Auto merge of rust-lang#128378 - matthiaskrgr:rollup-i3qz9uo, r=matthiaskrgr
a50fe57 Auto merge of rust-lang#128250 - Amanieu:select_unpredictable, r=nikic
47f9d61 Rollup merge of rust-lang#128315 - zetanumbers:psvita-unsafe-in-unsafe, r=workingjubilee
f70ce7f Auto merge of rust-lang#128234 - jcsp:retain-empty-case, r=tgross35
93b2f7c Insert some blank lines.
db0222e Move a comment.
cc96f3e Stabilize offset_of_nested
618fdd5 Auto merge of rust-lang#128334 - matthiaskrgr:rollup-nhxdt0c, r=matthiaskrgr
e088cb1 Rollup merge of rust-lang#128333 - RalfJung:miri-sync, r=RalfJung
1ea0493 Rollup merge of rust-lang#128307 - ojeda:unescaped_backticks, r=GuillaumeGomez
5d51099 Optimize empty case in Vec::retain
f2bcbec Auto merge of rust-lang#125016 - nicholasbishop:bishop-cb-112, r=tgross35
7a43feb Rollup merge of rust-lang#128310 - kmicklas:btree-map-peek-next-docs, r=tgross35
03e5078 Rollup merge of rust-lang#128055 - workingjubilee:deny-unsafe-ops-in-sys-personality-dwarf-eh, r=Amanieu
f9befad Rollup merge of rust-lang#109174 - soerenmeier:cursor_fns, r=dtolnay
ed7d02f Update compiler_builtins to 0.1.114
80254cd Warn on `rustdoc::unescaped_backticks` for `core/alloc/std/test/proc_macro`
c8db8ea Remove spurious backticks detected by `rustdoc::unescaped_backticks`
d1d4fb3 Reformat `use` declarations.
3ec244f Replace `io::Cursor::{remaining_slice, is_empty}` with `io::Cursor::{split, split_mut}`
abc611f step cfg(bootstrap)
78cd779 Update CURRENT_RUSTC_VERSION
70927dc Add forbid(unsafe_op_in_unsafe_fn)
06a22c9 Rollup merge of rust-lang#128240 - mbrubeck:patch-3, r=joboet
604d618 Rollup merge of rust-lang#128228 - slanterns:const_waker, r=dtolnay,oli-obk
2a70839 Rollup merge of rust-lang#128103 - folkertdev:unsigned-int-is-multiple-of, r=Amanieu
058f1d3 Rollup merge of rust-lang#127765 - bitfield:fix_stdlib_doc_nits, r=dtolnay
9a6c84e fix: psvita's std code
5119266 Force LLVM to use CMOV for binary search
d6b6e63 stabilize const_waker
8e4f58a Add missing periods on `BTreeMap` cursor `peek_next` docs
458b9b0 Implement cursors for `BTreeSet`
02bf0de Enable `std::io::copy` specialisation for `std::pipe::{PipeReader, PipeWriter}`
1f83bf3 Rollup merge of rust-lang#128282 - pitaj:nonzero_bitwise, r=workingjubilee
357ff7a Rollup merge of rust-lang#128279 - slanterns:is_sorted, r=dtolnay
fcbdcae stabilize `is_sorted`
c47f8bd bitwise and bytewise methods on `NonZero`
4ea98d7 Rollup merge of rust-lang#128259 - sunshowers:msg-nosignal, r=Mark-Simulacrum
d6f970a Rollup merge of rust-lang#125897 - RalfJung:from-ref, r=Amanieu
339f756 Auto merge of rust-lang#128255 - stepancheg:doc-shl, r=scottmcm
0d6a7dd Merge from rustc
a66bc79 Auto merge of rust-lang#127946 - tgross35:fmt-builders-set-result, r=cuviper
2986bfe [illumos/solaris] set MSG_NOSIGNAL while writing to sockets
3e85493 Document int.checked_shl(BITS - 1)
59f3fef Rollup merge of rust-lang#128235 - harryscholes:fix-iterator-filter-docs, r=tgross35
a2dbfd3 Rollup merge of rust-lang#124941 - Skgland:stabilize-const-int-from-str, r=dtolnay
5b78bae Add links from `assert_eq!` docs to `debug_assert_eq!`, etc.
a0f135d Always set `result` during `finish()` in debug builders
bd11b3d Fix  docs
22ce603 Auto merge of rust-lang#128165 - saethlin:optimize-clone-shims, r=compiler-errors
fb7d2a8 Fix doc nits
a152820 Rollup merge of rust-lang#128170 - saethlin:clone-fn, r=compiler-errors
0d63614 Merge from rustc
cb8f69b Rollup merge of rust-lang#128211 - juliusl:pr/align-change-time, r=tgross35
ba0582b Rollup merge of rust-lang#128150 - BoxyUwU:std_only_sized_const_params, r=workingjubilee
30cfde4 Rollup merge of rust-lang#127950 - nnethercote:rustfmt-skip-on-use-decls, r=cuviper
8488ae6 Make Clone::clone a lang item
1342ef1 fix: compilation issue w/ refactored type
92c0ad7 Let InstCombine remove Clone shims inside Clone shims
c788415 Stop using `unsized_const_parameters` in core/std
ef4d4a0 Auto merge of rust-lang#128195 - matthiaskrgr:rollup-195dfdf, r=matthiaskrgr
5b6c1e1 Rollup merge of rust-lang#128137 - GrigorenkoPV:cstr-derive, r=dtolnay
aaeac06 Rollup merge of rust-lang#127999 - ChrisDenton:arm32, r=Amanieu
ea3a99f Rollup merge of rust-lang#128158 - workingjubilee:unsafe-wrap-personality-gcc, r=ChrisDenton
886fe5b Rollup merge of rust-lang#127300 - biabbas:fix_connect_timeout, r=tgross35
b889a1d CStr: derive PartialEq, Eq; add test for Ord
3a18110 In connect timeout, read readiness of socket for vxworks. Check pollhup or pollerr for refused connections in linux
c4ee91f Merge from rustc
244d843 std: update comments on gcc personality fn
d252b6b std: unsafe-wrap gcc::rust_eh_personality and impl
09bda4f Rollup merge of rust-lang#128135 - joboet:reduplicate_tls, r=tgross35
a4c88bc Rollup merge of rust-lang#128046 - GrigorenkoPV:90435, r=tgross35
2614d86 Rollup merge of rust-lang#126548 - rik86189:issue-88264-fix, r=tgross35
75a178f Rollup merge of rust-lang#126042 - davidzeng0:master, r=Amanieu
1e118ae Rollup merge of rust-lang#128131 - ChrisDenton:stuff, r=workingjubilee
cea2ca9 Rollup merge of rust-lang#128120 - compiler-errors:async-fn-name, r=oli-obk
92e3688 Rollup merge of rust-lang#127733 - GrigorenkoPV:don't-forget, r=Amanieu
9b1cffd Rollup merge of rust-lang#127480 - biabbas:vxworks, r=workingjubilee
2632261 Rollup merge of rust-lang#127252 - fitzgen:edge-cases-for-bitwise-operations, r=m-ou-se
b0d7414 Rollup merge of rust-lang#126152 - RalfJung:size_of_val_raw, r=saethlin
6d0b714 Improved clarity of documentation for std::fs::create_dir_all
eb79e09 std: use duplicate thread local state in tests
8456a97 Forbid unsafe_op_in_unsafe_fn in sys/pal/windows
5a9fb1f Import `core::ffi::c_void` in more places
16450f7 Merge from rustc
697c717 Add chroot unsupported implementation for VxWorks
6242470 Rollup merge of rust-lang#128106 - hallfox:patch-1, r=ChrisDenton
de086ea Rollup merge of rust-lang#128092 - ChrisDenton:wrappers, r=workingjubilee
ccba33c Rollup merge of rust-lang#128043 - safinaskar:primitive, r=workingjubilee
a069998 Rollup merge of rust-lang#127481 - a1phyr:pattern_gat, r=Amanieu
bc7345c Rollup merge of rust-lang#126770 - wr7:master, r=Amanieu
21f6b65 Rollup merge of rust-lang#125962 - Coekjan:const-binary-heap, r=Amanieu
eee5bba Auto merge of rust-lang#127153 - NobodyXu:pipe, r=ChrisDenton
fd3a45f Gate AsyncFn* under async_closure feature
0374ea2 Add elem_offset and related methods
2b3eacb library/core/src/primitive.rs: small doc fix
45f80e6 Fix return type of FileAttr methods on AIX target
6cabb65 add `is_multiple_of` for unsigned integer types
4c4a93a Initial implementation of anonymous_pipe
63d2997 Update process vxworks, set default stack size of 256 Kib for vxworks. User can set the stack size using RUST_MIN_STACK, with min size of libc::PTHREAD_STACK_MIN(4kib)
ee86041 Rollup merge of rust-lang#128089 - workingjubilee:commonly-wrapped-to-make-safe, r=ChrisDenton
ad9a52d Rollup merge of rust-lang#125834 - workingjubilee:weaken-thir-unsafeck-for-addr-of-static-mut, r=compiler-errors
642c69b Remove wrapper functions from c.rs
de2a037 std: Unsafe-wrap backtrace code held in-common
155aef9 std: Unsafe-wrap alloc code held in-common
bee0155 Cfg disable on_broken_pipe_flag_used() for vxworks
227b5af Disable dirfd for vxworks, Return unsupported error from set_times and lchown for vxworks
22a6797 Allow unused unsafe for vxworks in read_at and write at
8be45a9 Docs for core::primitive: mention that "core" can be shadowed, too, so we should write "::core"
c039ee8 library: vary unsafety in bootstrapping for SEH
6765b97 std: unsafe-wrap personality::dwarf::eh
7ae76f0 Rollup merge of rust-lang#128008 - weiznich:fix/121521, r=lcnr
323e962 Rollup merge of rust-lang#127996 - ian-h-chamberlain:fix/horizon-warnings-unsafe-in-unsafe, r=tgross35
ae6187f Rollup merge of rust-lang#127415 - AljoschaMeyer:master, r=dtolnay
d6a36f5 Use given allocator instad of Global
d0bc9a0 Start using `#[diagnostic::do_not_recommend]` in the standard library
ba43261 Rollup merge of rust-lang#127583 - Nilstrieb:invalid-utf8, r=joboet
0727e53 Fix warnings when checking armv6k-nintendo-3ds
bbe4da8 Fix some `#[cfg_attr(not(doc), repr(..))]`
321dbf8 Deal with invalid UTF-8 from `gai_strerror`
6aa00e1 std::thread: available_parallelism implementation for vxWorks proposal.
2fff48d Auto merge of rust-lang#127722 - BoxyUwU:new_adt_const_params_limitations, r=compiler-errors
d7770e9 Rollup merge of rust-lang#128005 - ChrisDenton:msvc-include, r=joboet
8fdee23 Rollup merge of rust-lang#127734 - ChrisDenton:netc, r=Mark-Simulacrum
3b2536e Remove _tls_used hack
07dbb38 Rollup merge of rust-lang#127873 - workingjubilee:forbid-unsafe-ops-for-kmc-solid, r=Amanieu
bd26295 Rollup merge of rust-lang#127843 - workingjubilee:break-up-big-ass-stack-overflow-fn, r=joboet
00b4f61 Inject win arm32 shims into metadata generation
2b62867 Rollup merge of rust-lang#127918 - ChrisDenton:thread-name-string, r=joboet
a077eb1 Rollup merge of rust-lang#123196 - Ayush1325:uefi-process, r=joboet
eb09be4 std: forbid unwrapped unsafe in unsupported_backslash
dcb9854 kmc-solid: forbid(unsafe_op_in_unsafe_fn)
845a2f7 Auto merge of rust-lang#127982 - matthiaskrgr:rollup-nzyvphj, r=matthiaskrgr
00d6fc4 Rollup merge of rust-lang#127978 - nyurik:lib-refs, r=workingjubilee
4d8afcd Avoid ref when using format! for perf
9f20a0f Rollup merge of rust-lang#126199 - ivan-shrimp:nonzero_isqrt, r=tgross35
f06530c Rollup merge of rust-lang#112328 - juliusl:pr/windows-add-change-time, r=ChrisDenton
8d5cf50 uefi: process: Fixes from PR
c6cb67c uefi: process: Final Touchups
afe1ef0 uefi: process: Add CommandArgs support
ef6b173 uefi: process: Add support for args
1991fe3 uefi: process Implement inherit
24a9582 uefi: process: Add null protocol
36a0e1e uefi: process: Add stderr support
b712e74 uefi: process: Add support to capture stdout
e6eeb4e uefi: Add process
f3b1c8a improve safety comment
9348998 add `NonZero<uN>::isqrt`
edc4cdc Use `#[rustfmt::skip]` on some `use` groups to prevent reordering.
489f1ef unix: acquire-load NEED_ALTSTACK
9e11e01 unix: Unsafe-wrap stack_overflow::{drop,make}_handler
72c7444 unix: Unsafe-wrap stack_overflow::cleanup
33a32f2 unix: lift init of sigaltstack before sigaction
9fb6e49 unix: Unsafe-wrap stack_overflow::signal_handler
c99ebd4 Rollup merge of rust-lang#127594 - c6c7:fuchsia-status-code-match-arm, r=tmandry
8378261 Move ThreadName conversions to &cstr/&str
68e2391 Style change
16bce8a Make `Thread::new_inner` a safe function
d1d9893 Rollup merge of rust-lang#127748 - scottmcm:option_len, r=joboet
b0c85ba Rollup merge of rust-lang#124881 - Sp00ph:reentrant_lock_tid, r=joboet
7e21850 Update `ReentrantLock` implementation, add `CURRENT_ID` thread local.
c10a929 Safely enforce thread name requirements
cc4ed95 Rollup merge of rust-lang#127077 - tbu-:pr_doc_fd_to_owned, r=workingjubilee
37d7bff Rollup merge of rust-lang#127861 - Kriskras99:patch-1, r=tgross35
3d50720 Rollup merge of rust-lang#127859 - RalfJung:ptr-dyn-metadata, r=scottmcm
1f3311b Rollup merge of rust-lang#127845 - workingjubilee:actually-break-up-big-ass-stack-overflow-fn, r=joboet
5578593 Auto merge of rust-lang#127865 - matthiaskrgr:rollup-8m49dlg, r=matthiaskrgr
54728b1 feat: adding ext that returns change_time for Windows
b164bab Auto merge of rust-lang#125942 - timokroeger:windows-once-futex, r=ChrisDenton
0eda3a3 Rollup merge of rust-lang#127337 - celinval:intrinsics-fallback, r=oli-obk
ed3c6d1 Mention how you can go from `BorrowedFd` to `OwnedFd` and back
455bd57 Make language around `ToOwned` for `BorrowedFd` more precise
ab7a0d4 Document the column numbers for the dbg! macro
89cd225 ptr::metadata: update comment on vtable_ptr work-around
51e54a4 ptr::metadata: avoid references to extern types
be0c06b Split part of `adt_const_params` into `unsized_const_params`
857ed93 Forbid `!Sized` types and references
aedc16c unix: unsafe-wrap install_main_guard_default
4db3aa1 unix: clean up install_main_guard_freebsd
d167f00 unix: stack_start_aligned is a safe fn
27b79e6 unix: split stack_overflow::install_main_guard by os
d50143f Update name of Windows abort constant to match platform documentation
cbaa831 Add match arm for Fuchsia status code upon an abort in a test
f15715f lib: replace some `mem::forget`'s with `ManuallyDrop`
9bbf09d Windows: move BSD socket shims to netc
d76c965 Remove generic lifetime parameter of trait `Pattern`
ad3db57 Use Option's discriminant as its size hint
3b86ae3 Explicitly ignore `into_raw_handle()` using `let _ =` in sys/pal/windows.
1cb5354 Add `must_use` to IntoRawFd/IntoRawSocket/IntoRawHandle's methods.
697377a Clarify/add `must_use` messages for more `into_raw*` functions of `alloc` types.
a7bec56 size_of_val_raw: for length 0 this is safe to call
39c4daa Reset sigpipe not supported for vxworks
ca537d2 Fix them doc examples some more
be23cef Fix doc examples
8d01996 Run formatter on alloc/src/boxed.rs
c3b602a Add missing try_new_uninit_slice_in and try_new_zeroed_slice_in
5487574 Document safety of a few intrinsics
87fcd2f Move a few intrinsics to use Rust abi
6b549ba mark `can_not_overflow` as `#[rustc_const_stable(...)]`
259c058 stabilize `const_int_from_str`
538fe81 Add edge-case examples to `{count,leading,trailing}_{ones,zeros}` methods
5fc66dd Implement `unsigned_signed_diff`
dbbb4ab less garbage, more examples
4952644 update tracking issue for `const_binary_heap_new_in`
33389b0 more explicitly state the basic rules of working with the obtained raw pointers
395ad9f Windows: Use futex implementation for `Once`
7953644 from_ref, from_mut: clarify domain of quantification

git-subtree-dir: library
git-subtree-split: 9cc3bc6
carolynzech added a commit to carolynzech/verify-rust-std that referenced this pull request Aug 16, 2024
9cc3bc6 custom MIR: add support for tail calls
5674d1c Auto merge of rust-lang#128673 - matthiaskrgr:rollup-gtvpkm7, r=matthiaskrgr
deb1d75 Rollup merge of rust-lang#128619 - glandium:last_chunk, r=scottmcm
6449537 Rollup merge of rust-lang#128609 - swenson:smaller-faster-dragon, r=Amanieu
acb2c30 Rollup merge of rust-lang#128026 - devnexen:available_parallelism_vxworks, r=Mark-Simulacrum
89fe6df Rollup merge of rust-lang#128309 - kmicklas:btreeset-cursor, r=Amanieu
313484b Correct the const stabilization of `<[T]>::last_chunk`
22e026b Auto merge of rust-lang#128534 - bjorn3:split_stdlib_workspace, r=Mark-Simulacrum
1813603 Rollup merge of rust-lang#128526 - tshepang:patch-1, r=Amanieu
e8a1a41 Auto merge of rust-lang#128466 - sayantn:stdarch-update, r=tgross35
2adf9da Update stdarch
dc85bdb Chore: add `x86_amx_intrinsics` feature flag to `core/lib.rs` and remove `issue-120720-reduce-nan.rs`
e88b04d Rollup merge of rust-lang#128551 - Konippi:refactor-backtrace-style-in-panic, r=tgross35
43a1e93 Rollup merge of rust-lang#128530 - scottmcm:repeat-n-unchecked, r=joboet
47df194 Remove unnecessary constants from flt2dec dragon
0b5f1b8 Auto merge of rust-lang#128404 - compiler-errors:revert-dead-code-changes, r=pnkfelix
35cd95f Suppress new false-negatives that were masked by dead code analysis changes
9eb9fa6 Revert "Rollup merge of rust-lang#127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix"
975dc19 Rollup merge of rust-lang#128368 - nnethercote:rustfmt-tweaks, r=cuviper
0ee09fe Rollup merge of rust-lang#128303 - NobodyXu:specialise-for-pipe, r=cuviper
1967a12 Rollup merge of rust-lang#127586 - zachs18:more-must-use, r=cuviper
fc53324 Rollup merge of rust-lang#126704 - sayantn:sha, r=Amanieu
74dd96f chore: refactor backtrace style in panic
0e4358d Auto merge of rust-lang#128528 - workingjubilee:you-dont-need-to-see-this-cpuid-move-along, r=Amanieu
9fa74ab Move the standard library to a separate workspace
e13d132 Auto merge of rust-lang#128254 - Amanieu:orig-binary-search, r=tgross35
05d8d7c Implement `UncheckedIterator` directly for `RepeatN`
a5fa13e Rollup merge of rust-lang#128491 - c410-f3r:unlock-rfc-2011, r=workingjubilee
28e4d22 Rollup merge of rust-lang#128453 - RalfJung:raw_eq, r=saethlin
db770c6 std: Remove has_cpuid
39aad04 time.rs: remove "Basic usage text"
7df583c Dogfood
cb11051 Add the `sha512`, `sm3` and `sm4` target features
86ea79f Fix mutability in doc tests for `BTreeSet` cursors
c7be27f Introduce `Cursor`/`CursorMut`/`CursorMutKey` thrichotomy for `BTreeSet` like map API
8835b0f Fix some uses of "map" instead of "set" in `BTreeSet` cursor API docs
07f64a8 Share `UnorderedKeyError` with `BTReeMap` for set API
f859e54 Rollup merge of rust-lang#128499 - Konippi:refactor-backtrace-formatting, r=tgross35
fb966d2 Rollup merge of rust-lang#128497 - Bryanskiy:fix-dropck-doc, r=lcnr
ab00ae6 Rollup merge of rust-lang#128433 - hermit-os:hermit-unsafe_op_in_unsafe_fn, r=joboet
2614bd2 chore: refactor backtrace formatting
a8a4659 fix dropck documentation for `[T;0]` special-case
589c0a0 fix(os/hermit): `deny(unsafe_op_in_unsafe_fn)`
0260e47 fix(pal/hermit): `deny(unsafe_op_in_unsafe_fn)`
7bd6b11 refactor(pal/hermit): make `ENV` a non-mutable static
32894e2 Rollup merge of rust-lang#128416 - maurer:remove-android-hack, r=tgross35
beb76c3 Auto merge of rust-lang#128461 - matthiaskrgr:rollup-3dpp11g, r=matthiaskrgr
1e3976b Rollup merge of rust-lang#128162 - ChrisDenton:cleanup, r=joboet
cde45b0 Rollup merge of rust-lang#127567 - joboet:once_wait, r=Amanieu
0607642 Fix docs for OnceLock::get_mut_or_init
da48417 raw_eq: using it on bytes with provenance is not UB (outside const-eval)
cc6f37f std: fix busy-waiting in `Once::wait_force`, add more tests
6fd82f1 std: implement the `once_wait` feature
0c56873 Remove unneeded `pub(crate)`
787a1f7 Rollup merge of rust-lang#128388 - beetrees:f16-f128-slightly-improve-windows-abi, r=tgross35
e3a4ed3 Rollup merge of rust-lang#128387 - liigo:patch-14, r=tgross35
8b7f4ee refactor(pal/hermit): use default impl of `GlobalAlloc::alloc_zeroed`
c337019 refactor(pal/hermit): return `!` to satisfy rust-analyzer
7aafdcf android: Remove libstd hacks for unsupported Android APIs
ba65c6c Move Windows implementation of anon pipe
176508c Match LLVM ABI in `extern "C"` functions for `f128` on Windows
85e4ba0 Cleanup sys module to match house style
ddff2b6 Auto merge of rust-lang#128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68
e4b0e6d Rewrite binary search implementation
556dc60 More detailed note to deprecate ONCE_INIT
440ec83 Auto merge of rust-lang#128378 - matthiaskrgr:rollup-i3qz9uo, r=matthiaskrgr
a50fe57 Auto merge of rust-lang#128250 - Amanieu:select_unpredictable, r=nikic
47f9d61 Rollup merge of rust-lang#128315 - zetanumbers:psvita-unsafe-in-unsafe, r=workingjubilee
f70ce7f Auto merge of rust-lang#128234 - jcsp:retain-empty-case, r=tgross35
93b2f7c Insert some blank lines.
db0222e Move a comment.
cc96f3e Stabilize offset_of_nested
618fdd5 Auto merge of rust-lang#128334 - matthiaskrgr:rollup-nhxdt0c, r=matthiaskrgr
e088cb1 Rollup merge of rust-lang#128333 - RalfJung:miri-sync, r=RalfJung
1ea0493 Rollup merge of rust-lang#128307 - ojeda:unescaped_backticks, r=GuillaumeGomez
5d51099 Optimize empty case in Vec::retain
f2bcbec Auto merge of rust-lang#125016 - nicholasbishop:bishop-cb-112, r=tgross35
7a43feb Rollup merge of rust-lang#128310 - kmicklas:btree-map-peek-next-docs, r=tgross35
03e5078 Rollup merge of rust-lang#128055 - workingjubilee:deny-unsafe-ops-in-sys-personality-dwarf-eh, r=Amanieu
f9befad Rollup merge of rust-lang#109174 - soerenmeier:cursor_fns, r=dtolnay
ed7d02f Update compiler_builtins to 0.1.114
80254cd Warn on `rustdoc::unescaped_backticks` for `core/alloc/std/test/proc_macro`
c8db8ea Remove spurious backticks detected by `rustdoc::unescaped_backticks`
d1d4fb3 Reformat `use` declarations.
3ec244f Replace `io::Cursor::{remaining_slice, is_empty}` with `io::Cursor::{split, split_mut}`
abc611f step cfg(bootstrap)
78cd779 Update CURRENT_RUSTC_VERSION
70927dc Add forbid(unsafe_op_in_unsafe_fn)
06a22c9 Rollup merge of rust-lang#128240 - mbrubeck:patch-3, r=joboet
604d618 Rollup merge of rust-lang#128228 - slanterns:const_waker, r=dtolnay,oli-obk
2a70839 Rollup merge of rust-lang#128103 - folkertdev:unsigned-int-is-multiple-of, r=Amanieu
058f1d3 Rollup merge of rust-lang#127765 - bitfield:fix_stdlib_doc_nits, r=dtolnay
9a6c84e fix: psvita's std code
5119266 Force LLVM to use CMOV for binary search
d6b6e63 stabilize const_waker
8e4f58a Add missing periods on `BTreeMap` cursor `peek_next` docs
458b9b0 Implement cursors for `BTreeSet`
02bf0de Enable `std::io::copy` specialisation for `std::pipe::{PipeReader, PipeWriter}`
1f83bf3 Rollup merge of rust-lang#128282 - pitaj:nonzero_bitwise, r=workingjubilee
357ff7a Rollup merge of rust-lang#128279 - slanterns:is_sorted, r=dtolnay
fcbdcae stabilize `is_sorted`
c47f8bd bitwise and bytewise methods on `NonZero`
4ea98d7 Rollup merge of rust-lang#128259 - sunshowers:msg-nosignal, r=Mark-Simulacrum
d6f970a Rollup merge of rust-lang#125897 - RalfJung:from-ref, r=Amanieu
339f756 Auto merge of rust-lang#128255 - stepancheg:doc-shl, r=scottmcm
0d6a7dd Merge from rustc
a66bc79 Auto merge of rust-lang#127946 - tgross35:fmt-builders-set-result, r=cuviper
2986bfe [illumos/solaris] set MSG_NOSIGNAL while writing to sockets
3e85493 Document int.checked_shl(BITS - 1)
59f3fef Rollup merge of rust-lang#128235 - harryscholes:fix-iterator-filter-docs, r=tgross35
a2dbfd3 Rollup merge of rust-lang#124941 - Skgland:stabilize-const-int-from-str, r=dtolnay
5b78bae Add links from `assert_eq!` docs to `debug_assert_eq!`, etc.
a0f135d Always set `result` during `finish()` in debug builders
bd11b3d Fix  docs
22ce603 Auto merge of rust-lang#128165 - saethlin:optimize-clone-shims, r=compiler-errors
fb7d2a8 Fix doc nits
a152820 Rollup merge of rust-lang#128170 - saethlin:clone-fn, r=compiler-errors
0d63614 Merge from rustc
cb8f69b Rollup merge of rust-lang#128211 - juliusl:pr/align-change-time, r=tgross35
ba0582b Rollup merge of rust-lang#128150 - BoxyUwU:std_only_sized_const_params, r=workingjubilee
30cfde4 Rollup merge of rust-lang#127950 - nnethercote:rustfmt-skip-on-use-decls, r=cuviper
8488ae6 Make Clone::clone a lang item
1342ef1 fix: compilation issue w/ refactored type
92c0ad7 Let InstCombine remove Clone shims inside Clone shims
c788415 Stop using `unsized_const_parameters` in core/std
ef4d4a0 Auto merge of rust-lang#128195 - matthiaskrgr:rollup-195dfdf, r=matthiaskrgr
5b6c1e1 Rollup merge of rust-lang#128137 - GrigorenkoPV:cstr-derive, r=dtolnay
aaeac06 Rollup merge of rust-lang#127999 - ChrisDenton:arm32, r=Amanieu
ea3a99f Rollup merge of rust-lang#128158 - workingjubilee:unsafe-wrap-personality-gcc, r=ChrisDenton
886fe5b Rollup merge of rust-lang#127300 - biabbas:fix_connect_timeout, r=tgross35
b889a1d CStr: derive PartialEq, Eq; add test for Ord
3a18110 In connect timeout, read readiness of socket for vxworks. Check pollhup or pollerr for refused connections in linux
c4ee91f Merge from rustc
244d843 std: update comments on gcc personality fn
d252b6b std: unsafe-wrap gcc::rust_eh_personality and impl
09bda4f Rollup merge of rust-lang#128135 - joboet:reduplicate_tls, r=tgross35
a4c88bc Rollup merge of rust-lang#128046 - GrigorenkoPV:90435, r=tgross35
2614d86 Rollup merge of rust-lang#126548 - rik86189:issue-88264-fix, r=tgross35
75a178f Rollup merge of rust-lang#126042 - davidzeng0:master, r=Amanieu
1e118ae Rollup merge of rust-lang#128131 - ChrisDenton:stuff, r=workingjubilee
cea2ca9 Rollup merge of rust-lang#128120 - compiler-errors:async-fn-name, r=oli-obk
92e3688 Rollup merge of rust-lang#127733 - GrigorenkoPV:don't-forget, r=Amanieu
9b1cffd Rollup merge of rust-lang#127480 - biabbas:vxworks, r=workingjubilee
2632261 Rollup merge of rust-lang#127252 - fitzgen:edge-cases-for-bitwise-operations, r=m-ou-se
b0d7414 Rollup merge of rust-lang#126152 - RalfJung:size_of_val_raw, r=saethlin
6d0b714 Improved clarity of documentation for std::fs::create_dir_all
eb79e09 std: use duplicate thread local state in tests
8456a97 Forbid unsafe_op_in_unsafe_fn in sys/pal/windows
5a9fb1f Import `core::ffi::c_void` in more places
16450f7 Merge from rustc
697c717 Add chroot unsupported implementation for VxWorks
6242470 Rollup merge of rust-lang#128106 - hallfox:patch-1, r=ChrisDenton
de086ea Rollup merge of rust-lang#128092 - ChrisDenton:wrappers, r=workingjubilee
ccba33c Rollup merge of rust-lang#128043 - safinaskar:primitive, r=workingjubilee
a069998 Rollup merge of rust-lang#127481 - a1phyr:pattern_gat, r=Amanieu
bc7345c Rollup merge of rust-lang#126770 - wr7:master, r=Amanieu
21f6b65 Rollup merge of rust-lang#125962 - Coekjan:const-binary-heap, r=Amanieu
eee5bba Auto merge of rust-lang#127153 - NobodyXu:pipe, r=ChrisDenton
fd3a45f Gate AsyncFn* under async_closure feature
0374ea2 Add elem_offset and related methods
2b3eacb library/core/src/primitive.rs: small doc fix
45f80e6 Fix return type of FileAttr methods on AIX target
6cabb65 add `is_multiple_of` for unsigned integer types
4c4a93a Initial implementation of anonymous_pipe
63d2997 Update process vxworks, set default stack size of 256 Kib for vxworks. User can set the stack size using RUST_MIN_STACK, with min size of libc::PTHREAD_STACK_MIN(4kib)
ee86041 Rollup merge of rust-lang#128089 - workingjubilee:commonly-wrapped-to-make-safe, r=ChrisDenton
ad9a52d Rollup merge of rust-lang#125834 - workingjubilee:weaken-thir-unsafeck-for-addr-of-static-mut, r=compiler-errors
642c69b Remove wrapper functions from c.rs
de2a037 std: Unsafe-wrap backtrace code held in-common
155aef9 std: Unsafe-wrap alloc code held in-common
bee0155 Cfg disable on_broken_pipe_flag_used() for vxworks
227b5af Disable dirfd for vxworks, Return unsupported error from set_times and lchown for vxworks
22a6797 Allow unused unsafe for vxworks in read_at and write at
8be45a9 Docs for core::primitive: mention that "core" can be shadowed, too, so we should write "::core"
c039ee8 library: vary unsafety in bootstrapping for SEH
6765b97 std: unsafe-wrap personality::dwarf::eh
7ae76f0 Rollup merge of rust-lang#128008 - weiznich:fix/121521, r=lcnr
323e962 Rollup merge of rust-lang#127996 - ian-h-chamberlain:fix/horizon-warnings-unsafe-in-unsafe, r=tgross35
ae6187f Rollup merge of rust-lang#127415 - AljoschaMeyer:master, r=dtolnay
d6a36f5 Use given allocator instad of Global
d0bc9a0 Start using `#[diagnostic::do_not_recommend]` in the standard library
ba43261 Rollup merge of rust-lang#127583 - Nilstrieb:invalid-utf8, r=joboet
0727e53 Fix warnings when checking armv6k-nintendo-3ds
bbe4da8 Fix some `#[cfg_attr(not(doc), repr(..))]`
321dbf8 Deal with invalid UTF-8 from `gai_strerror`
6aa00e1 std::thread: available_parallelism implementation for vxWorks proposal.
2fff48d Auto merge of rust-lang#127722 - BoxyUwU:new_adt_const_params_limitations, r=compiler-errors
d7770e9 Rollup merge of rust-lang#128005 - ChrisDenton:msvc-include, r=joboet
8fdee23 Rollup merge of rust-lang#127734 - ChrisDenton:netc, r=Mark-Simulacrum
3b2536e Remove _tls_used hack
07dbb38 Rollup merge of rust-lang#127873 - workingjubilee:forbid-unsafe-ops-for-kmc-solid, r=Amanieu
bd26295 Rollup merge of rust-lang#127843 - workingjubilee:break-up-big-ass-stack-overflow-fn, r=joboet
00b4f61 Inject win arm32 shims into metadata generation
2b62867 Rollup merge of rust-lang#127918 - ChrisDenton:thread-name-string, r=joboet
a077eb1 Rollup merge of rust-lang#123196 - Ayush1325:uefi-process, r=joboet
eb09be4 std: forbid unwrapped unsafe in unsupported_backslash
dcb9854 kmc-solid: forbid(unsafe_op_in_unsafe_fn)
845a2f7 Auto merge of rust-lang#127982 - matthiaskrgr:rollup-nzyvphj, r=matthiaskrgr
00d6fc4 Rollup merge of rust-lang#127978 - nyurik:lib-refs, r=workingjubilee
4d8afcd Avoid ref when using format! for perf
9f20a0f Rollup merge of rust-lang#126199 - ivan-shrimp:nonzero_isqrt, r=tgross35
f06530c Rollup merge of rust-lang#112328 - juliusl:pr/windows-add-change-time, r=ChrisDenton
8d5cf50 uefi: process: Fixes from PR
c6cb67c uefi: process: Final Touchups
afe1ef0 uefi: process: Add CommandArgs support
ef6b173 uefi: process: Add support for args
1991fe3 uefi: process Implement inherit
24a9582 uefi: process: Add null protocol
36a0e1e uefi: process: Add stderr support
b712e74 uefi: process: Add support to capture stdout
e6eeb4e uefi: Add process
f3b1c8a improve safety comment
9348998 add `NonZero<uN>::isqrt`
edc4cdc Use `#[rustfmt::skip]` on some `use` groups to prevent reordering.
489f1ef unix: acquire-load NEED_ALTSTACK
9e11e01 unix: Unsafe-wrap stack_overflow::{drop,make}_handler
72c7444 unix: Unsafe-wrap stack_overflow::cleanup
33a32f2 unix: lift init of sigaltstack before sigaction
9fb6e49 unix: Unsafe-wrap stack_overflow::signal_handler
c99ebd4 Rollup merge of rust-lang#127594 - c6c7:fuchsia-status-code-match-arm, r=tmandry
8378261 Move ThreadName conversions to &cstr/&str
68e2391 Style change
16bce8a Make `Thread::new_inner` a safe function
d1d9893 Rollup merge of rust-lang#127748 - scottmcm:option_len, r=joboet
b0c85ba Rollup merge of rust-lang#124881 - Sp00ph:reentrant_lock_tid, r=joboet
7e21850 Update `ReentrantLock` implementation, add `CURRENT_ID` thread local.
c10a929 Safely enforce thread name requirements
cc4ed95 Rollup merge of rust-lang#127077 - tbu-:pr_doc_fd_to_owned, r=workingjubilee
37d7bff Rollup merge of rust-lang#127861 - Kriskras99:patch-1, r=tgross35
3d50720 Rollup merge of rust-lang#127859 - RalfJung:ptr-dyn-metadata, r=scottmcm
1f3311b Rollup merge of rust-lang#127845 - workingjubilee:actually-break-up-big-ass-stack-overflow-fn, r=joboet
5578593 Auto merge of rust-lang#127865 - matthiaskrgr:rollup-8m49dlg, r=matthiaskrgr
54728b1 feat: adding ext that returns change_time for Windows
b164bab Auto merge of rust-lang#125942 - timokroeger:windows-once-futex, r=ChrisDenton
0eda3a3 Rollup merge of rust-lang#127337 - celinval:intrinsics-fallback, r=oli-obk
ed3c6d1 Mention how you can go from `BorrowedFd` to `OwnedFd` and back
455bd57 Make language around `ToOwned` for `BorrowedFd` more precise
ab7a0d4 Document the column numbers for the dbg! macro
89cd225 ptr::metadata: update comment on vtable_ptr work-around
51e54a4 ptr::metadata: avoid references to extern types
be0c06b Split part of `adt_const_params` into `unsized_const_params`
857ed93 Forbid `!Sized` types and references
aedc16c unix: unsafe-wrap install_main_guard_default
4db3aa1 unix: clean up install_main_guard_freebsd
d167f00 unix: stack_start_aligned is a safe fn
27b79e6 unix: split stack_overflow::install_main_guard by os
d50143f Update name of Windows abort constant to match platform documentation
cbaa831 Add match arm for Fuchsia status code upon an abort in a test
f15715f lib: replace some `mem::forget`'s with `ManuallyDrop`
9bbf09d Windows: move BSD socket shims to netc
d76c965 Remove generic lifetime parameter of trait `Pattern`
ad3db57 Use Option's discriminant as its size hint
3b86ae3 Explicitly ignore `into_raw_handle()` using `let _ =` in sys/pal/windows.
1cb5354 Add `must_use` to IntoRawFd/IntoRawSocket/IntoRawHandle's methods.
697377a Clarify/add `must_use` messages for more `into_raw*` functions of `alloc` types.
a7bec56 size_of_val_raw: for length 0 this is safe to call
39c4daa Reset sigpipe not supported for vxworks
ca537d2 Fix them doc examples some more
be23cef Fix doc examples
8d01996 Run formatter on alloc/src/boxed.rs
c3b602a Add missing try_new_uninit_slice_in and try_new_zeroed_slice_in
5487574 Document safety of a few intrinsics
87fcd2f Move a few intrinsics to use Rust abi
6b549ba mark `can_not_overflow` as `#[rustc_const_stable(...)]`
259c058 stabilize `const_int_from_str`
538fe81 Add edge-case examples to `{count,leading,trailing}_{ones,zeros}` methods
5fc66dd Implement `unsigned_signed_diff`
dbbb4ab less garbage, more examples
4952644 update tracking issue for `const_binary_heap_new_in`
33389b0 more explicitly state the basic rules of working with the obtained raw pointers
395ad9f Windows: Use futex implementation for `Once`
7953644 from_ref, from_mut: clarify domain of quantification

git-subtree-dir: library
git-subtree-split: 9cc3bc6
@Amanieu Amanieu added the relnotes Marks issues that should be documented in the release notes of the next release. label Aug 20, 2024
@Mark-Simulacrum Mark-Simulacrum added relnotes Marks issues that should be documented in the release notes of the next release. and removed relnotes Marks issues that should be documented in the release notes of the next release. labels Aug 25, 2024
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Oct 18, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [rust](https://github.com/rust-lang/rust) | minor | `1.81.0` -> `1.82.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>rust-lang/rust (rust)</summary>

### [`v1.82.0`](https://github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1820-2024-10-17)

[Compare Source](rust-lang/rust@1.81.0...1.82.0)

\==========================

<a id="1.82.0-Language"></a>

## Language

-   [Don't make statement nonterminals match pattern nonterminals](rust-lang/rust#120221)
-   [Patterns matching empty types can now be omitted in common cases](rust-lang/rust#122792)
-   [Enforce supertrait outlives obligations when using trait impls](rust-lang/rust#124336)
-   [`addr_of(_mut)!` macros and the newly stabilized `&raw (const|mut)` are now safe to use with all static items](rust-lang/rust#125834)
-   [size_of_val_raw: for length 0 this is safe to call](rust-lang/rust#126152)
-   [Reorder trait bound modifiers *after* `for<...>` binder in trait bounds](rust-lang/rust#127054)
-   [Stabilize opaque type precise capturing (RFC 3617)](rust-lang/rust#127672)
-   [Stabilize `&raw const` and `&raw mut` operators (RFC 2582)](rust-lang/rust#127679)
-   [Stabilize unsafe extern blocks (RFC 3484)](rust-lang/rust#127921)
-   [Stabilize nested field access in `offset_of!`](rust-lang/rust#128284)
-   [Do not require `T` to be live when dropping `[T; 0]`](rust-lang/rust#128438)
-   [Stabilize `const` operands in inline assembly](rust-lang/rust#128570)
-   [Stabilize floating-point arithmetic in `const fn`](rust-lang/rust#128596)
-   [Stabilize explicit opt-in to unsafe attributes](rust-lang/rust#128771)
-   [Document NaN bit patterns guarantees](rust-lang/rust#129559)

<a id="1.82.0-Compiler"></a>

## Compiler

-   [Promote riscv64gc-unknown-linux-musl to tier 2](rust-lang/rust#122049)
-   [Promote Mac Catalyst targets `aarch64-apple-ios-macabi` and `x86_64-apple-ios-macabi` to Tier 2, and ship them with rustup](rust-lang/rust#126450)
-   [Add tier 3 NuttX based targets for RISC-V and ARM](rust-lang/rust#127755)
-   [Add tier 3 powerpc-unknown-linux-muslspe target](rust-lang/rust#127905)
-   [Improved diagnostics to explain why a pattern is unreachable](rust-lang/rust#128034)
-   [The compiler now triggers the unreachable code warning properly for async functions that don't return/are `-> !`](rust-lang/rust#128443)
-   [Promote `aarch64-apple-darwin` to Tier 1](rust-lang/rust#128592)
-   [Add Trusty OS target `aarch64-unknown-trusty` and `armv7-unknown-trusty` as tier 3 targets](rust-lang/rust#129490)
-   [Promote `wasm32-wasip2` to Tier 2.](rust-lang/rust#126967)

<a id="1.82.0-Libraries"></a>

## Libraries

-   [Generalize `{Rc,Arc}::make_mut()` to `Path`, `OsStr`, and `CStr`.](rust-lang/rust#126877)

<a id="1.82.0-Stabilized-APIs"></a>

## Stabilized APIs

-   [`std::thread::Builder::spawn_unchecked`](https://doc.rust-lang.org/stable/std/thread/struct.Builder.html#method.spawn_unchecked)
-   [`std::str::CharIndices::offset`](https://doc.rust-lang.org/nightly/std/str/struct.CharIndices.html#method.offset)
-   [`std::option::Option::is_none_or`](https://doc.rust-lang.org/nightly/std/option/enum.Option.html#method.is_none_or)
-   [`[T]::is_sorted`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.is_sorted)
-   [`[T]::is_sorted_by`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.is_sorted_by)
-   [`[T]::is_sorted_by_key`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.is_sorted_by_key)
-   [`Iterator::is_sorted`](https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.is_sorted)
-   [`Iterator::is_sorted_by`](https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.is_sorted_by)
-   [`Iterator::is_sorted_by_key`](https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.is_sorted_by_key)
-   [`std::future::Ready::into_inner`](https://doc.rust-lang.org/nightly/std/future/struct.Ready.html#method.into_inner)
-   [`std::iter::repeat_n`](https://doc.rust-lang.org/nightly/std/iter/fn.repeat_n.html)
-   [`impl<T: Clone> DoubleEndedIterator for Take<Repeat<T>>`](https://doc.rust-lang.org/nightly/std/iter/struct.Take.html#impl-DoubleEndedIterator-for-Take%3CRepeat%3CT%3E%3E)
-   [`impl<T: Clone> ExactSizeIterator for Take<Repeat<T>>`](https://doc.rust-lang.org/nightly/std/iter/struct.Take.html#impl-ExactSizeIterator-for-Take%3CRepeat%3CT%3E%3E)
-   [`impl<T: Clone> ExactSizeIterator for Take<RepeatWith<T>>`](https://doc.rust-lang.org/nightly/std/iter/struct.Take.html#impl-ExactSizeIterator-for-Take%3CRepeatWith%3CF%3E%3E)
-   [`impl Default for std::collections::binary_heap::Iter`](https://doc.rust-lang.org/nightly/std/collections/binary_heap/struct.Iter.html#impl-Default-for-Iter%3C'\_,+T%3E)
-   [`impl Default for std::collections::btree_map::RangeMut`](https://doc.rust-lang.org/nightly/std/collections/btree_map/struct.RangeMut.html#impl-Default-for-RangeMut%3C'\_,+K,+V%3E)
-   [`impl Default for std::collections::btree_map::ValuesMut`](https://doc.rust-lang.org/nightly/std/collections/btree_map/struct.ValuesMut.html#impl-Default-for-ValuesMut%3C'\_,+K,+V%3E)
-   [`impl Default for std::collections::vec_deque::Iter`](https://doc.rust-lang.org/nightly/std/collections/vec_deque/struct.Iter.html#impl-Default-for-Iter%3C'\_,+T%3E)
-   [`impl Default for std::collections::vec_deque::IterMut`](https://doc.rust-lang.org/nightly/std/collections/vec_deque/struct.IterMut.html#impl-Default-for-IterMut%3C'\_,+T%3E)
-   [`Rc<T>::new_uninit`](https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.new_uninit)
-   [`Rc<T>::assume_init`](https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.assume_init)
-   [`Rc<[T]>::new_uninit_slice`](https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.new_uninit_slice)
-   [`Rc<[MaybeUninit<T>]>::assume_init`](https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.assume_init-1)
-   [`Arc<T>::new_uninit`](https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.new_uninit)
-   [`Arc<T>::assume_init`](https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.assume_init)
-   [`Arc<[T]>::new_uninit_slice`](https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.new_uninit_slice)
-   [`Arc<[MaybeUninit<T>]>::assume_init`](https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.assume_init-1)
-   [`Box<T>::new_uninit`](https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.new_uninit)
-   [`Box<T>::assume_init`](https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.assume_init)
-   [`Box<[T]>::new_uninit_slice`](https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.new_uninit_slice)
-   [`Box<[MaybeUninit<T>]>::assume_init`](https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.assume_init-1)
-   [`core::arch::x86_64::_bextri_u64`](https://doc.rust-lang.org/stable/core/arch/x86\_64/fn.\_bextri_u64.html)
-   [`core::arch::x86_64::_bextri_u32`](https://doc.rust-lang.org/stable/core/arch/x86\_64/fn.\_bextri_u32.html)
-   [`core::arch::x86::_mm_broadcastsi128_si256`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_broadcastsi128\_si256.html)
-   [`core::arch::x86::_mm256_stream_load_si256`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm256\_stream_load_si256.html)
-   [`core::arch::x86::_tzcnt_u16`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_tzcnt_u16.html)
-   [`core::arch::x86::_mm_extracti_si64`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_extracti_si64.html)
-   [`core::arch::x86::_mm_inserti_si64`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_inserti_si64.html)
-   [`core::arch::x86::_mm_storeu_si16`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_storeu_si16.html)
-   [`core::arch::x86::_mm_storeu_si32`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_storeu_si32.html)
-   [`core::arch::x86::_mm_storeu_si64`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_storeu_si64.html)
-   [`core::arch::x86::_mm_loadu_si16`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_loadu_si16.html)
-   [`core::arch::x86::_mm_loadu_si32`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_loadu_si32.html)
-   [`core::arch::wasm32::u8x16_relaxed_swizzle`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u8x16\_relaxed_swizzle.html)
-   [`core::arch::wasm32::i8x16_relaxed_swizzle`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i8x16\_relaxed_swizzle.html)
-   [`core::arch::wasm32::i32x4_relaxed_trunc_f32x4`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4\_relaxed_trunc_f32x4.html)
-   [`core::arch::wasm32::u32x4_relaxed_trunc_f32x4`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4\_relaxed_trunc_f32x4.html)
-   [`core::arch::wasm32::i32x4_relaxed_trunc_f64x2_zero`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4\_relaxed_trunc_f64x2\_zero.html)
-   [`core::arch::wasm32::u32x4_relaxed_trunc_f64x2_zero`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4\_relaxed_trunc_f64x2\_zero.html)
-   [`core::arch::wasm32::f32x4_relaxed_madd`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4\_relaxed_madd.html)
-   [`core::arch::wasm32::f32x4_relaxed_nmadd`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4\_relaxed_nmadd.html)
-   [`core::arch::wasm32::f64x2_relaxed_madd`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2\_relaxed_madd.html)
-   [`core::arch::wasm32::f64x2_relaxed_nmadd`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2\_relaxed_nmadd.html)
-   [`core::arch::wasm32::i8x16_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i8x16\_relaxed_laneselect.html)
-   [`core::arch::wasm32::u8x16_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u8x16\_relaxed_laneselect.html)
-   [`core::arch::wasm32::i16x8_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i16x8\_relaxed_laneselect.html)
-   [`core::arch::wasm32::u16x8_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u16x8\_relaxed_laneselect.html)
-   [`core::arch::wasm32::i32x4_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4\_relaxed_laneselect.html)
-   [`core::arch::wasm32::u32x4_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4\_relaxed_laneselect.html)
-   [`core::arch::wasm32::i64x2_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i64x2\_relaxed_laneselect.html)
-   [`core::arch::wasm32::u64x2_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u64x2\_relaxed_laneselect.html)
-   [`core::arch::wasm32::f32x4_relaxed_min`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4\_relaxed_min.html)
-   [`core::arch::wasm32::f32x4_relaxed_max`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4\_relaxed_max.html)
-   [`core::arch::wasm32::f64x2_relaxed_min`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2\_relaxed_min.html)
-   [`core::arch::wasm32::f64x2_relaxed_max`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2\_relaxed_max.html)
-   [`core::arch::wasm32::i16x8_relaxed_q15mulr`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i16x8\_relaxed_q15mulr.html)
-   [`core::arch::wasm32::u16x8_relaxed_q15mulr`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u16x8\_relaxed_q15mulr.html)
-   [`core::arch::wasm32::i16x8_relaxed_dot_i8x16_i7x16`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i16x8\_relaxed_dot_i8x16\_i7x16.html)
-   [`core::arch::wasm32::u16x8_relaxed_dot_i8x16_i7x16`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u16x8\_relaxed_dot_i8x16\_i7x16.html)
-   [`core::arch::wasm32::i32x4_relaxed_dot_i8x16_i7x16_add`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4\_relaxed_dot_i8x16\_i7x16\_add.html)
-   [`core::arch::wasm32::u32x4_relaxed_dot_i8x16_i7x16_add`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4\_relaxed_dot_i8x16\_i7x16\_add.html)

These APIs are now stable in const contexts:

-   [`std::task::Waker::from_raw`](https://doc.rust-lang.org/nightly/std/task/struct.Waker.html#method.from_raw)
-   [`std::task::Context::from_waker`](https://doc.rust-lang.org/nightly/std/task/struct.Context.html#method.from_waker)
-   [`std::task::Context::waker`](https://doc.rust-lang.org/nightly/std/task/struct.Context.html#method.waker)
-   [`$integer::from_str_radix`](https://doc.rust-lang.org/nightly/std/primitive.u32.html#method.from_str_radix)
-   [`std::num::ParseIntError::kind`](https://doc.rust-lang.org/nightly/std/num/struct.ParseIntError.html#method.kind)

<a id="1.82.0-Cargo"></a>

## Cargo

-   [feat: Add `info` cargo subcommand](rust-lang/cargo#14141)

<a id="1.82.0-Compatibility-Notes"></a>

## Compatibility Notes

-   We now [disallow setting some built-in cfgs via the command-line](rust-lang/rust#126158) with the newly added [`explicit_builtin_cfgs_in_flags`](https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html#explicit-builtin-cfgs-in-flags) lint in order to prevent incoherent state, eg. `windows` cfg active but target is Linux based. The appropriate [`rustc` flag](https://doc.rust-lang.org/rustc/command-line-arguments.html) should be used instead.
-   The standard library has a new implementation of `binary_search` which is significantly improves performance ([#&#8203;128254](rust-lang/rust#128254)). However when a sorted slice has multiple values which compare equal, the new implementation may select a different value among the equal ones than the old implementation.
-   [illumos/Solaris now sets `MSG_NOSIGNAL` when writing to sockets](rust-lang/rust#128259). This avoids killing the process with SIGPIPE when writing to a closed socket, which matches the existing behavior on other UNIX targets.
-   [Removes a problematic hack that always passed the --whole-archive linker flag for tests, which may cause linker errors for code accidentally relying on it.](rust-lang/rust#128400)
-   The WebAssembly target features `multivalue` and `reference-types` are now
    both enabled by default. These two features both have subtle changes implied
    for generated WebAssembly binaries. For the `multivalue` feature, WebAssembly
    target support has changed when upgrading to LLVM 19. Support for generating
    functions with multiple returns no longer works and
    `-Ctarget-feature=+multivalue` has a different meaning than it did in LLVM 18
    and prior. There is no longer any supported means to generate a module that has
    a function with multiple returns in WebAssembly from Rust source code. For the
    `reference-types` feature the encoding of immediates in the `call_indirect`, a
    commonly used instruction by the WebAssembly backend, has changed. Validators
    and parsers which don't understand the `reference-types` proposal will no
    longer accept modules produced by LLVM due to this change in encoding of
    immediates. Additionally these features being enabled are encoded in the
    `target_features` custom section and may affect downstream tooling such as
    `wasm-opt` consuming the module. Generating a WebAssembly module that disables
    default features requires `-Zbuild-std` support from Cargo and more information
    can be found at
    [rust-lang/rust#128511](rust-lang/rust#128511).
-   [Rust now raises unsafety errors for union patterns in parameter-position](rust-lang/rust#130531)

<a id="1.82.0-Internal-Changes"></a>

## Internal Changes

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

-   [Update to LLVM 19](rust-lang/rust#127513)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request Oct 27, 2024
Pkgsrc changes:
 * Adapt patches, apply to new vendored crates where needed.
 * Back-port rust pull request 130110, "make dist vendoring configurable"
 * Disable "dist vendoring", otherwise cargo would try to access
   the network during the build phase.

Upstream changes:

Version 1.82.0 (2024-10-17)
==========================

Language
--------
- [Don't make statement nonterminals match pattern nonterminals]
  (rust-lang/rust#120221)
- [Patterns matching empty types can now be omitted in common cases]
  (rust-lang/rust#122792)
- [Enforce supertrait outlives obligations when using trait impls]
  (rust-lang/rust#124336)
- [`addr_of(_mut)!` macros and the newly stabilized `&raw (const|mut)`
  are now safe to use with all static items]
  (rust-lang/rust#125834)
- [size_of_val_raw: for length 0 this is safe to call]
  (rust-lang/rust#126152)
- [Reorder trait bound modifiers *after* `for<...>` binder in trait bounds]
  (rust-lang/rust#127054)
- [Stabilize opaque type precise capturing (RFC 3617)]
  (rust-lang/rust#127672)
- [Stabilize `&raw const` and `&raw mut` operators (RFC 2582)]
  (rust-lang/rust#127679)
- [Stabilize unsafe extern blocks (RFC 3484)]
  (rust-lang/rust#127921)
- [Stabilize nested field access in `offset_of!`]
  (rust-lang/rust#128284)
- [Do not require `T` to be live when dropping `[T; 0]`]
  (rust-lang/rust#128438)
- [Stabilize `const` operands in inline assembly]
  (rust-lang/rust#128570)
- [Stabilize floating-point arithmetic in `const fn`]
  (rust-lang/rust#128596)
- [Stabilize explicit opt-in to unsafe attributes]
  (rust-lang/rust#128771)
- [Document NaN bit patterns guarantees]
  (rust-lang/rust#129559)

Compiler
--------
- [Promote riscv64gc-unknown-linux-musl to tier 2]
  (rust-lang/rust#122049)
- [Promote Mac Catalyst targets `aarch64-apple-ios-macabi` and
  `x86_64-apple-ios-macabi` to Tier 2, and ship them with rustup]
  (rust-lang/rust#126450)
- [Add tier 3 NuttX based targets for RISC-V and ARM]
  (rust-lang/rust#127755)
- [Add tier 3 powerpc-unknown-linux-muslspe target]
  (rust-lang/rust#127905)
- [Improved diagnostics to explain why a pattern is unreachable]
  (rust-lang/rust#128034)
- [The compiler now triggers the unreachable code warning properly
  for async functions that don't return/are `-> !`]
  (rust-lang/rust#128443)
- [Promote `aarch64-apple-darwin` to Tier 1]
  (rust-lang/rust#128592)
- [Add Trusty OS target `aarch64-unknown-trusty` and `armv7-unknown-trusty`
  as tier 3 targets] (rust-lang/rust#129490)
- [Promote `wasm32-wasip2` to Tier 2.]
  (rust-lang/rust#126967)

Libraries
---------
- [Generalize `{Rc,Arc}::make_mut()` to `Path`, `OsStr`, and `CStr`.]
  (rust-lang/rust#126877)

Stabilized APIs
---------------
- [`std::thread::Builder::spawn_unchecked`]
  (https://doc.rust-lang.org/stable/std/thread/struct.Builder.html#method.spawn_unchecked)
- [`std::str::CharIndices::offset`]
  (https://doc.rust-lang.org/nightly/std/str/struct.CharIndices.html#method.offset)
- [`std::option::Option::is_none_or`]
  (https://doc.rust-lang.org/nightly/std/option/enum.Option.html#method.is_none_or)
- [`[T]::is_sorted`]
  (https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.is_sorted)
- [`[T]::is_sorted_by`]
  (https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.is_sorted_by)
- [`[T]::is_sorted_by_key`]
  (https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.is_sorted_by_key)
- [`Iterator::is_sorted`]
  (https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.is_sorted)
- [`Iterator::is_sorted_by`]
  (https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.is_sorted_by)
- [`Iterator::is_sorted_by_key`]
  (https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.is_sorted_by_key)
- [`std::future::Ready::into_inner`]
  (https://doc.rust-lang.org/nightly/std/future/struct.Ready.html#method.into_inner)
- [`std::iter::repeat_n`]
  (https://doc.rust-lang.org/nightly/std/iter/fn.repeat_n.html)
- [`impl<T: Clone> DoubleEndedIterator for Take<Repeat<T>>`]
  (https://doc.rust-lang.org/nightly/std/iter/struct.Take.html#impl-DoubleEndedIterator-for-Take%3CRepeat%3CT%3E%3E)
- [`impl<T: Clone> ExactSizeIterator for Take<Repeat<T>>`]
  (https://doc.rust-lang.org/nightly/std/iter/struct.Take.html#impl-ExactSizeIterator-for-Take%3CRepeat%3CT%3E%3E)
- [`impl<T: Clone> ExactSizeIterator for Take<RepeatWith<T>>`]
  (https://doc.rust-lang.org/nightly/std/iter/struct.Take.html#impl-ExactSizeIterator-for-Take%3CRepeatWith%3CF%3E%3E)
- [`impl Default for std::collections::binary_heap::Iter`]
  (https://doc.rust-lang.org/nightly/std/collections/binary_heap/struct.Iter.html#impl-Default-for-Iter%3C'_,+T%3E)
- [`impl Default for std::collections::btree_map::RangeMut`]
  (https://doc.rust-lang.org/nightly/std/collections/btree_map/struct.RangeMut.html#impl-Default-for-RangeMut%3C'_,+K,+V%3E)
- [`impl Default for std::collections::btree_map::ValuesMut`]
  (https://doc.rust-lang.org/nightly/std/collections/btree_map/struct.ValuesMut.html#impl-Default-for-ValuesMut%3C'_,+K,+V%3E)
- [`impl Default for std::collections::vec_deque::Iter`]
  (https://doc.rust-lang.org/nightly/std/collections/vec_deque/struct.Iter.html#impl-Default-for-Iter%3C'_,+T%3E)
- [`impl Default for std::collections::vec_deque::IterMut`]
  (https://doc.rust-lang.org/nightly/std/collections/vec_deque/struct.IterMut.html#impl-Default-for-IterMut%3C'_,+T%3E)
- [`Rc<T>::new_uninit`]
  (https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.new_uninit)
- [`Rc<T>::assume_init`]
  (https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.assume_init)
- [`Rc<[T]>::new_uninit_slice`]
  (https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.new_uninit_slice)
- [`Rc<[MaybeUninit<T>]>::assume_init`]
  (https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.assume_init-1)
- [`Arc<T>::new_uninit`]
  (https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.new_uninit)
- [`Arc<T>::assume_init`]
  (https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.assume_init)
- [`Arc<[T]>::new_uninit_slice`]
  (https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.new_uninit_slice)
- [`Arc<[MaybeUninit<T>]>::assume_init`]
  (https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.assume_init-1)
- [`Box<T>::new_uninit`]
  (https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.new_uninit)
- [`Box<T>::assume_init`]
  (https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.assume_init)
- [`Box<[T]>::new_uninit_slice`]
  (https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.new_uninit_slice)
- [`Box<[MaybeUninit<T>]>::assume_init`]
  (https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.assume_init-1)
- [`core::arch::x86_64::_bextri_u64`]
  (https://doc.rust-lang.org/stable/core/arch/x86_64/fn._bextri_u64.html)
- [`core::arch::x86_64::_bextri_u32`]
  (https://doc.rust-lang.org/stable/core/arch/x86_64/fn._bextri_u32.html)
- [`core::arch::x86::_mm_broadcastsi128_si256`]
  (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_broadcastsi128_si256.html)
- [`core::arch::x86::_mm256_stream_load_si256`]
  (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm256_stream_load_si256.html)
- [`core::arch::x86::_tzcnt_u16`]
  (https://doc.rust-lang.org/stable/core/arch/x86/fn._tzcnt_u16.html)
- [`core::arch::x86::_mm_extracti_si64`]
  (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_extracti_si64.html)
- [`core::arch::x86::_mm_inserti_si64`]
  (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_inserti_si64.html)
- [`core::arch::x86::_mm_storeu_si16`]
  (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_storeu_si16.html)
- [`core::arch::x86::_mm_storeu_si32`]
  (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_storeu_si32.html)
- [`core::arch::x86::_mm_storeu_si64`]
  (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_storeu_si64.html)
- [`core::arch::x86::_mm_loadu_si16`]
  (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_loadu_si16.html)
- [`core::arch::x86::_mm_loadu_si32`]
  (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_loadu_si32.html)
- [`core::arch::wasm32::u8x16_relaxed_swizzle`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u8x16_relaxed_swizzle.html)
- [`core::arch::wasm32::i8x16_relaxed_swizzle`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i8x16_relaxed_swizzle.html)
- [`core::arch::wasm32::i32x4_relaxed_trunc_f32x4`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4_relaxed_trunc_f32x4.html)
- [`core::arch::wasm32::u32x4_relaxed_trunc_f32x4`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4_relaxed_trunc_f32x4.html)
- [`core::arch::wasm32::i32x4_relaxed_trunc_f64x2_zero`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4_relaxed_trunc_f64x2_zero.html)
- [`core::arch::wasm32::u32x4_relaxed_trunc_f64x2_zero`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4_relaxed_trunc_f64x2_zero.html)
- [`core::arch::wasm32::f32x4_relaxed_madd`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4_relaxed_madd.html)
- [`core::arch::wasm32::f32x4_relaxed_nmadd`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4_relaxed_nmadd.html)
- [`core::arch::wasm32::f64x2_relaxed_madd`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2_relaxed_madd.html)
- [`core::arch::wasm32::f64x2_relaxed_nmadd`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2_relaxed_nmadd.html)
- [`core::arch::wasm32::i8x16_relaxed_laneselect`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i8x16_relaxed_laneselect.html)
- [`core::arch::wasm32::u8x16_relaxed_laneselect`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u8x16_relaxed_laneselect.html)
- [`core::arch::wasm32::i16x8_relaxed_laneselect`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i16x8_relaxed_laneselect.html)
- [`core::arch::wasm32::u16x8_relaxed_laneselect`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u16x8_relaxed_laneselect.html)
- [`core::arch::wasm32::i32x4_relaxed_laneselect`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4_relaxed_laneselect.html)
- [`core::arch::wasm32::u32x4_relaxed_laneselect`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4_relaxed_laneselect.html)
- [`core::arch::wasm32::i64x2_relaxed_laneselect`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i64x2_relaxed_laneselect.html)
- [`core::arch::wasm32::u64x2_relaxed_laneselect`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u64x2_relaxed_laneselect.html)
- [`core::arch::wasm32::f32x4_relaxed_min`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4_relaxed_min.html)
- [`core::arch::wasm32::f32x4_relaxed_max`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4_relaxed_max.html)
- [`core::arch::wasm32::f64x2_relaxed_min`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2_relaxed_min.html)
- [`core::arch::wasm32::f64x2_relaxed_max`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2_relaxed_max.html)
- [`core::arch::wasm32::i16x8_relaxed_q15mulr`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i16x8_relaxed_q15mulr.html)
- [`core::arch::wasm32::u16x8_relaxed_q15mulr`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u16x8_relaxed_q15mulr.html)
- [`core::arch::wasm32::i16x8_relaxed_dot_i8x16_i7x16`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i16x8_relaxed_dot_i8x16_i7x16.html)
- [`core::arch::wasm32::u16x8_relaxed_dot_i8x16_i7x16`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u16x8_relaxed_dot_i8x16_i7x16.html)
- [`core::arch::wasm32::i32x4_relaxed_dot_i8x16_i7x16_add`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4_relaxed_dot_i8x16_i7x16_add.html)
- [`core::arch::wasm32::u32x4_relaxed_dot_i8x16_i7x16_add`]
  (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4_relaxed_dot_i8x16_i7x16_add.html)

These APIs are now stable in const contexts:

- [`std::task::Waker::from_raw`]
  (https://doc.rust-lang.org/nightly/std/task/struct.Waker.html#method.from_raw)
- [`std::task::Waker::waker`]
  (https://doc.rust-lang.org/nightly/std/task/struct.Waker.html#method.from_raw)
- [`std::task::Context::from_waker`]
  (https://doc.rust-lang.org/nightly/std/task/struct.Context.html#method.from_waker)
- [`std::task::Context::waker`]
  (https://doc.rust-lang.org/nightly/std/task/struct.Context.html#method.waker)
- [`$integer::from_str_radix`]
  (https://doc.rust-lang.org/nightly/std/primitive.u32.html#method.from_str_radix)
- [`std::num::ParseIntError::kind`]
  (https://doc.rust-lang.org/nightly/std/num/struct.ParseIntError.html#method.kind)

Cargo
-----
- [feat: Add `info` cargo subcommand]
  (rust-lang/cargo#14141)

Compatibility Notes
-------------------
 - We now [disallow setting some built-in cfgs via the
   command-line](rust-lang/rust#126158) with
   the newly added
   [`explicit_builtin_cfgs_in_flags`]
   (https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html#explicit-builtin-cfgs-in-flags)
   lint in order to prevent incoherent state, eg. `windows` cfg active
   but target is Linux based. The appropriate [`rustc` flag]
   (https://doc.rust-lang.org/rustc/command-line-arguments.html)
   should be used instead.

- The standard library has a new implementation of `binary_search`
  which is significantly improves performance
  ([#128254](rust-lang/rust#128254)). However
  when a sorted slice has multiple values which compare equal, the
  new implementation may select a different value among the equal
  ones than the old implementation.

- [illumos/Solaris now sets `MSG_NOSIGNAL` when writing to
  sockets](rust-lang/rust#128259). This avoids
  killing the process with SIGPIPE when writing to a closed socket,
  which matches the existing behavior on other UNIX targets.

- [Removes a problematic hack that always passed the --whole-archive
  linker flag for tests, which may cause linker errors for code
  accidentally relying on it.]
  (rust-lang/rust#128400)

- The WebAssembly target features `multivalue` and `reference-types`
  are now both enabled by default. These two features both have
  subtle changes implied for generated WebAssembly binaries. For
  the `multivalue` feature, WebAssembly target support has changed
  when upgrading to LLVM 19. Support for generating functions with
  multiple returns no longer works and `-Ctarget-feature=+multivalue`
  has a different meaning than it did in LLVM 18 and prior. There
  is no longer any supported means to generate a module that has
  a function with multiple returns in WebAssembly from Rust source
  code. For the `reference-types` feature the encoding of immediates
  in the `call_indirect`, a commonly used instruction by the
  WebAssembly backend, has changed. Validators and parsers which
  don't understand the `reference-types` proposal will no longer
  accept modules produced by LLVM due to this change in encoding
  of immediates. Additionally these features being enabled are
  encoded in the `target_features` custom section and may affect
  downstream tooling such as `wasm-opt` consuming the module.
  Generating a WebAssembly module that disables default features
  requires `-Zbuild-std` support from Cargo and more information
  can be found at
  [rust-lang/rust#128511](rust-lang/rust#128511).
- [Rust now raises unsafety errors for union patterns in parameter-position]
  (rust-lang/rust#130531)

Internal Changes
----------------

These changes do not affect any public interfaces of Rust, but they
represent significant improvements to the performance or internals
of rustc and related tools.

- [Update to LLVM 19]
  (rust-lang/rust#127513)
// Binary search interacts poorly with branch prediction, so force
// the compiler to use conditional moves if supported by the target
// architecture.
base = select_unpredictable(cmp == Greater, base, mid);

Choose a reason for hiding this comment

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

This way you'll return last among equal elements.

But why not first? Simply change to:

base = select_unpredictable(cmp != Lesser, base, mid);

and then check base+1 element after the loop instead of base.

Strictly speaking, it is better to have several binary search functions: find first equal, find first greater, find last equal, find last lesser.

And they all could be implemented as "find first matching" (FFM) and "find last matching" (FLM) functions, passing v > needle/v >= needle to FFM and v < needle/v <= needle to FLM.

Choose a reason for hiding this comment

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

"Find First Matching" and "Find Last Matching" could be useful by themselves.

Copy link
Member Author

Choose a reason for hiding this comment

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

You can use partition_point for this. Call it twice to get a range of indices with all matching values.

Choose a reason for hiding this comment

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

You're right.

It looks to me, with last modification to binary_search, it is more natural to implement binary_search using partition_point, than opposite way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. 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.

performance regression of binary_search Binary search performance regressed in 1.25