Skip to content

Merge subtree update for toolchain nightly-2025-06-02 #378

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

Merged
merged 10,000 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
10000 commits
Select commit Hold shift + click to select a range
5f015ae
Rollup merge of #140759 - dpaoliello:symlink, r=workingjubilee
matthiaskrgr May 8, 2025
76e44fd
Indicate that the warning on black_box is a general property of Rust
saethlin Apr 26, 2025
b9cff0e
Rollup merge of #140341 - saethlin:black-box-qoi, r=Mark-Simulacrum
matthiaskrgr May 8, 2025
79f2d54
Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations
Urgau May 8, 2025
03b2493
remove 'unordered' atomic intrinsics
RalfJung May 5, 2025
af36f33
Add intrinsic fallback for `{minimum,maximum}{16,32,64,128}`
Urgau May 8, 2025
37508da
Split duration_constructors to get non-controversial bits out faster.
Dietr1ch May 9, 2025
2f893b0
Rollup merge of #129334 - ChayimFriedman2:more-lazy-methods, r=Amanieu
matthiaskrgr May 10, 2025
e528ad0
Rollup merge of #140151 - RalfJung:drop_in_place-is-not-an-intrinsic,…
matthiaskrgr May 10, 2025
80d5991
Rollup merge of #140660 - RalfJung:more-order, r=WaffleLapkin
matthiaskrgr May 10, 2025
c4479a6
Rollup merge of #140783 - veluca93:oncelock-docs, r=jhpratt
matthiaskrgr May 10, 2025
ef7dcf4
Rollup merge of #140789 - hermit-os:hermit-abi-0.5.1, r=Mark-Simulacrum
matthiaskrgr May 10, 2025
7597a7b
Remove `stable` attribute from wasi fs (read_exact|write_all)_at
paolobarbolini May 10, 2025
57657e9
Rollup merge of #140792 - Urgau:minimum-maximum-intrinsics, r=scottmc…
fmease May 11, 2025
0e7065f
Rollup merge of #140882 - Dietr1ch:dev/duration_constructors_lite, r=…
fmease May 11, 2025
638600f
Make some `f32`/`f64` tests also run in const-context
Urgau May 11, 2025
75003d6
update version placeholders
pietroalbini May 9, 2025
d8150f0
update cfg(bootstrap)
pietroalbini May 10, 2025
e76dbbe
manual clippy fixes
pietroalbini May 10, 2025
b719a60
Specify that split_ascii_whitespace uses the same definition as is_as…
SimonSapin May 12, 2025
b4a2b09
Add `#[must_use]` to Array::map
JulianKnodt May 13, 2025
36232ea
bump compiler_builtins
pietroalbini May 12, 2025
4356e4b
Format and skip formatting for pin
compiler-errors May 12, 2025
19ee7c2
Initial implementation of `core_float_math`
tgross35 Feb 25, 2025
6b1cadc
Move float tests from std to core
tgross35 Feb 25, 2025
6a63e13
fix doc for UnixStream
mlowicki May 14, 2025
10d7845
MaybeUninit::write: fix doc
mathisbot May 14, 2025
9e30ef6
Add `Ipv4Addr` and `Ipv6Addr` diagnostic items
samueltardieu May 13, 2025
f13399a
Fix set_name for vxworks. Length of name should be truncated to VX_TA…
biabbas May 14, 2025
82c2bc5
Fix settimes for vxworks
biabbas May 14, 2025
d8776f7
Move applicable float tests from `coretests` back to `std`
tgross35 Feb 25, 2025
9204318
Skip {f32,f64}::mul_add tests on MinGW
tgross35 Apr 30, 2025
bd0251d
Rollup merge of #140988 - mathisbot:docfix_maybeuninit_write, r=tgross35
matthiaskrgr May 14, 2025
e9c037c
wire up startupinfo methods
federico-terzi May 14, 2025
5d7c518
Fix confusing WTF surrogate safety docs
teor2345 May 12, 2025
c6d86b4
Update std doctests for android
ehuss May 15, 2025
1d9245f
deduplicate abort implementations
joboet Mar 29, 2025
bdab7e9
improve internal fastfail explainer
joboet Apr 21, 2025
d703306
Auto merge of #136264 - GuillaumeGomez:optimize-integers-to-string, r…
bors May 15, 2025
ec82d66
Rollup merge of #139749 - ruancomelli:docs/library/core/src/pin/fix-t…
matthiaskrgr May 15, 2025
583855e
Rollup merge of #140685 - viliml:patch-1, r=Mark-Simulacrum
matthiaskrgr May 15, 2025
a62cba7
Rollup merge of #140990 - biabbas:vxworks, r=tgross35
matthiaskrgr May 15, 2025
a31a781
Auto merge of #141050 - matthiaskrgr:rollup-uyzqbmj, r=matthiaskrgr
bors May 15, 2025
50e05bd
Updated std doctests for wasm
ehuss May 16, 2025
2c952dc
Rollup merge of #140791 - xizheyin:issue-140761, r=ibraheemdev
matthiaskrgr May 16, 2025
0da53a7
Rollup merge of #140910 - paolobarbolini:wasi-fs-incorrect-stabilizat…
matthiaskrgr May 16, 2025
2fed000
Rollup merge of #140984 - mlowicki:patch-2, r=ibraheemdev
matthiaskrgr May 16, 2025
4034981
Rollup merge of #141013 - federico-terzi:feat/command_startupinfo_win…
matthiaskrgr May 16, 2025
195806b
Updated feature and stable flags
May 16, 2025
eb4b16f
disable the stack overflow handler on miri
joboet May 5, 2025
0a1b5d2
Add as_ascii_unchecked() methods to char, str, and u8
Feb 22, 2025
9a8e3b6
Add assert_unsafe_precondition!()s to as_ascii_unchecked() methods
May 13, 2025
477fdff
Implement `advance_by` via `try_fold` for `Sized` iterators
a1phyr May 16, 2025
e16bfb5
Remove #![feature(let_chains)] from library and src/librustdoc
est31 May 13, 2025
e2664af
additional edge cases tests for `path.rs`
GrantBirki May 16, 2025
4db4525
Docs(lib/alloc/vec): Add the missing `an` to `extract_if`'s first sen…
PaulDance May 17, 2025
7b939b7
Docs(lib/coll/hm): Reword `extract_if` to use `element` instead of `v…
PaulDance May 17, 2025
908e4aa
Docs(lib/coll/btm): Split `extract_if`'s first sentence from the foll…
PaulDance May 17, 2025
550dcf6
Docs(lib/extract_if): Unify paragraph about closure actions
PaulDance May 17, 2025
dd5aae9
Docs(lib/extract_if): Unify paragraph about elements mutation
PaulDance May 17, 2025
792ebed
Docs(lib/coll/hm): Add kv pair to `extract_if`'s first sentence
PaulDance May 17, 2025
323be04
Docs(lib/extract_if): Unify example description
PaulDance May 17, 2025
b3dc829
discuss deadlocks in the std::io::pipe() example
oconnor663 May 17, 2025
62637c1
remove `test_embedded_null_byte()` test for now
GrantBirki May 17, 2025
68c4627
Rollup merge of #140957 - JulianKnodt:array_must_use, r=Mark-Simulacrum
matthiaskrgr May 17, 2025
90ffcdc
Switch library rustc_unimplemented to use `Self` and `This`
mejrs May 17, 2025
be1e653
Rollup merge of #137432 - djscythe:char_u8_str_as_ascii_unchecked, r=…
matthiaskrgr May 17, 2025
a7f5b55
Rollup merge of #139103 - joboet:abort_dedup, r=tgross35
matthiaskrgr May 17, 2025
6acf8f4
revert forward slash to backslash
GrantBirki May 17, 2025
14b7e26
remove extra tests that really might not be all that useful
GrantBirki May 17, 2025
695e4de
Auto merge of #138087 - tgross35:core-float-math, r=Amanieu
bors May 17, 2025
1cc592a
Stabilize `avx512_target_feature`
sayantn Apr 16, 2025
2038276
replace `try_reserve_exact` with `try_with_capacity` in `std::fs::read`
fluiderson May 18, 2025
759431a
Rollup merge of #140511 - mathisbot:master, r=dtolnay
fmease May 18, 2025
c1c89c6
Rollup merge of #140924 - Urgau:f32_f64_const_tests, r=Mark-Simulacrum
fmease May 18, 2025
a94d954
Rollup merge of #140966 - est31:let_chains_library, r=tgross35
fmease May 18, 2025
1e8b7d7
[std] fix the presentation of `split_off_mut` and `split_off` documen…
xizheyin May 17, 2025
8a7279e
float: Add `f16` parsing and printing
tgross35 Aug 25, 2024
e329c02
Rollup merge of #138940 - sayantn:stabilize-avx512, r=Amanieu,travisc…
fmease May 18, 2025
7d216b6
Rollup merge of #140628 - joboet:async_signal_safe, r=Mark-Simulacrum
fmease May 18, 2025
fcf38d1
float: Add tests for `f16` conversions to and from decimal
tgross35 Mar 8, 2025
d7766ca
Auto merge of #127013 - tgross35:f16-format-parse, r=Mark-Simulacrum
bors May 18, 2025
0ad44d7
Rollup merge of #141110 - xizheyin:issue-141107, r=workingjubilee
Zalathar May 19, 2025
2564a2c
add exact_div functions
Qelxiros May 19, 2025
4a99329
fix data race in ReentrantLock fallback for targets without 64bit ato…
RalfJung May 19, 2025
9f429e6
windows: document that we rely on an undocumented property of GetUser…
RalfJung May 19, 2025
46623d3
Add `std::io::Seek` instance for `std::io::Take`
melrief Mar 4, 2025
285ed6b
Rollup merge of #141248 - RalfJung:reentrant-lock-race, r=joboet
matthiaskrgr May 19, 2025
cc38593
Auto merge of #138023 - melrief:97227_impl_Seek_for_Take, r=tgross35
bors May 19, 2025
1989ab7
Rollup merge of #141211 - fluiderson:dev, r=thomcc
Zalathar May 20, 2025
be91512
make std::intrinsic functions actually be intrinsics
RalfJung Apr 16, 2025
fcfcd6b
Split `autodiff` into `autodiff_forward` and `autodiff_reverse`
Sa4dUs May 6, 2025
f9dbe85
use Self alias in self types rather than manually substituting it
compiler-errors May 20, 2025
50a5725
`core_float_math`: Move functions to `math` folder
DJMcNab May 20, 2025
9a14fe9
Add `std::os::unix::process::CommandExt::chroot` to safely chroot a c…
joshtriplett Feb 27, 2025
018271e
`CommandExt::chroot`: Document difference to underlying `chroot`
joshtriplett May 20, 2025
6c5aa0c
`CommandExt::chroot`: Add tracking issue
joshtriplett May 20, 2025
ae67855
Rollup merge of #141282 - DJMcNab:core-float-math-math, r=tgross35
matthiaskrgr May 20, 2025
b021a1d
Rollup merge of #141289 - compiler-errors:more-self, r=jhpratt
matthiaskrgr May 20, 2025
f1dce9d
Implement `ptr::try_cast_aligned` and `NonNull::try_cast_aligned`.
mathisbot May 18, 2025
486f309
Remove unnecessary handling of ERROR_IO_PENDING
cberner May 7, 2025
f4fcaca
Add From<TryLockError> for io::Error
cberner May 20, 2025
dda44a2
Rename `cfg_match!` to `cfg_select!`
tgross35 Feb 18, 2025
1c60f1f
Apply suggestions from code review
joshtriplett May 20, 2025
2dba03c
Rollup merge of #141222 - mathisbot:ptr_trycastaligned, r=tgross35
matthiaskrgr May 21, 2025
87b0fac
Add data_ptr method to Mutex and RwLock
jplatte Apr 27, 2025
fb83dec
Add more docs to new data_ptr methods
jplatte May 21, 2025
dc6d970
Add ReentrantLock::data_ptr
jplatte May 21, 2025
b58a848
Disable autodiff bootstrapping
Sa4dUs May 10, 2025
02d9329
Rollup merge of #137759 - joshtriplett:command-chroot, r=Amanieu
matthiaskrgr May 21, 2025
1bf1c7d
bump stdarch
RalfJung May 21, 2025
2738601
Add some track_caller info to precondition panics
saethlin Aug 27, 2024
de6bde3
limit impls of `VaArgSafe` to just types that are actually safe
folkertdev May 21, 2025
8b9e244
std: fix doctest and explain for as_slices and as_mut_slices in VecDeque
xizheyin May 18, 2025
b0c6d88
Rollup merge of #140526 - Natr1x:sort-direction-documentation, r=dtolnay
matthiaskrgr May 21, 2025
365198a
Rollup merge of #141230 - xizheyin:issue-141217, r=tgross35
matthiaskrgr May 21, 2025
2cfee4d
Rollup merge of #141341 - folkertdev:limit-VaArgSafe-impls, r=working…
matthiaskrgr May 21, 2025
66dc879
add doc alias `replace_first` for `str::replacen`
WaffleLapkin May 21, 2025
6669d52
Auto merge of #137198 - tgross35:cfg-match-rename, r=Amanieu
bors May 22, 2025
6101e4f
Rollup merge of #141337 - RalfJung:stdarch, r=Amanieu
matthiaskrgr May 22, 2025
dc9f842
Rollup merge of #141370 - WaffleLapkin:hiiii, r=jhpratt
matthiaskrgr May 22, 2025
25d0864
Auto merge of #141379 - matthiaskrgr:rollup-g1cz0ic, r=matthiaskrgr
bors May 22, 2025
c653602
try_cast_aligned: avoid bare int-to-ptr casts
RalfJung May 22, 2025
03098d2
Rollup merge of #141130 - mejrs:use_self, r=compiler-errors
matthiaskrgr May 22, 2025
afb6519
Rollup merge of #141381 - RalfJung:try_cast_aligned-strict-provenance…
matthiaskrgr May 22, 2025
0dd69e0
docs: fix typos
Dannyyy93 May 22, 2025
10ed7f5
Auto merge of #141396 - matthiaskrgr:rollup-feg050g, r=matthiaskrgr
bors May 22, 2025
5725a5b
Remove #![feature(let_chains)] from libcore
est31 May 22, 2025
381fab5
use `cfg_select!` to select the right `VaListImpl` definition
folkertdev May 21, 2025
525ef2f
Rollup merge of #141019 - ehuss:android-doctest-xcompile, r=Mark-Simu…
matthiaskrgr May 23, 2025
4c69136
Rollup merge of #141109 - oconnor663:pipe_example, r=Mark-Simulacrum
matthiaskrgr May 23, 2025
ac71cd2
std: fix aliasing bug in UNIX process implementation
joboet Mar 24, 2025
469428a
std: add safety comments to `CStringArray`
joboet Apr 21, 2025
b47ddfa
std: sys: net: uefi: Implement TCP4 connect
Ayush1325 Apr 2, 2025
1d0a148
Rollup merge of #138896 - joboet:process_noalias, r=Noratrieb
matthiaskrgr May 23, 2025
3308e19
Rollup merge of #141065 - ehuss:wasm-doctest-xcompile, r=Mark-Simulacrum
matthiaskrgr May 23, 2025
d0b9882
Rollup merge of #141398 - Dannyyy93:typos, r=Noratrieb
matthiaskrgr May 23, 2025
48c1553
GetUserProfileDirectoryW is now documented to always store the size
RalfJung May 22, 2025
6034214
Auto merge of #141415 - est31:let_chains_libcore, r=tgross35
bors May 24, 2025
074bf43
Rollup merge of #141405 - RalfJung:GetUserProfileDirectoryW, r=ChrisD…
matthiaskrgr May 24, 2025
04c1a04
Auto merge of #141484 - matthiaskrgr:rollup-dc58owu, r=matthiaskrgr
bors May 24, 2025
ea8398b
add CStr::display
tamird Apr 17, 2025
0cc8a77
Use C-string literals to reduce boilerplate
tamird May 24, 2025
c81153f
intrinsics: reduce references to LLVM and update notes on where the i…
RalfJung May 24, 2025
e4f7384
Rollup merge of #137323 - joshlf:transmute-npo, r=RalfJung
matthiaskrgr May 24, 2025
e2b0757
Rollup merge of #139254 - Ayush1325:uefi-tcp4-connect, r=joboet
matthiaskrgr May 24, 2025
dd3584c
rename internal panicking::try to catch_unwind
RalfJung May 24, 2025
5255409
Rollup merge of #140066 - thaliaarchi:const-array-as-mut-slice, r=jhp…
GuillaumeGomez May 24, 2025
24c8767
Rollup merge of #141105 - GrantBirki:grantbirki/path-tests, r=jhpratt
GuillaumeGomez May 24, 2025
b517086
Rollup merge of #141498 - tamird:cstr-example-noise, r=jhpratt
GuillaumeGomez May 24, 2025
265aa85
Rollup merge of #141505 - RalfJung:catch_unwind, r=Noratrieb
GuillaumeGomez May 24, 2025
cb0eb79
Path::with_extension: improve examples
tshepang May 24, 2025
ffde704
reduce clutter... too many imports
tshepang May 24, 2025
8797629
improve the `std::fs::create_dir_all` docs related to atomicity
fluiderson May 23, 2025
546dd13
Rollup merge of #141108 - PaulDance:fix-extract_if-docs, r=Mark-Simul…
jhpratt May 25, 2025
1d9af0c
Rollup merge of #141361 - folkertdev:varargs-cfg, r=workingjubilee
jhpratt May 25, 2025
4c3aa3c
clean up old rintf leftovers
RalfJung May 25, 2025
d578eff
Implement normalize lexically
ChrisDenton Dec 23, 2024
725b0db
Auto merge of #141086 - a1phyr:spec_advance_by, r=jhpratt
bors May 25, 2025
0019894
increase perf of charsearcher for single ascii characters
bend-n May 24, 2025
1f1f72f
Rollup merge of #134696 - ChrisDenton:normalize-lexically, r=workingj…
jhpratt May 26, 2025
7b2da84
Rollup merge of #140936 - teor2345:wtf-surrogate-docs, r=workingjubilee
jhpratt May 26, 2025
82715e1
Rollup merge of #140952 - SimonSapin:ascii_whitespace_definition, r=d…
jhpratt May 26, 2025
422d0d5
Rollup merge of #141472 - fluiderson:dev, r=workingjubilee
jhpratt May 26, 2025
a230e7a
Rollup merge of #141516 - bend-n:okay, r=workingjubilee
jieyouxu May 26, 2025
6e70eb6
Call out possibility of invariant result
jhpratt May 26, 2025
ebc29e0
core: begin deduplicating pointer docs
lolbinarycat May 26, 2025
556facc
Minor macro docs fixes
Sa4dUs May 26, 2025
6e0b09b
Merge from rustc
May 27, 2025
d9183fc
Rollup merge of #141582 - RalfJung:cleanup, r=bjorn3
compiler-errors May 27, 2025
8b7638d
Add Range parameter to `BTreeMap::extract_if` and `BTreeSet::extract_if`
rs-sac May 8, 2025
edaa3ee
Update tests with Range parameter to `BTreeMap::extract_if` etc.
rs-sac May 8, 2025
2b03f05
Update docs for new Range parameter to `BTreeMap::extract_if` etc.
rs-sac May 8, 2025
736223d
Unit test for Range parameter of `BTreeMap::extract_if`
rs-sac May 8, 2025
8a60737
Do not get proc_macro from the sysroot in rustc
bjorn3 May 27, 2025
de64aca
✨ feat: map_or_default for result and option
tkr-sh May 27, 2025
c4389da
Rollup merge of #141312 - cberner:filelock_from, r=joshtriplett
matthiaskrgr May 27, 2025
c3c5ff1
Auto merge of #129658 - saethlin:spare-a-crumb, r=jhpratt
bors May 27, 2025
7eb84f9
Rollup merge of #141659 - tkr-sh:map-or-default, r=Amanieu
tgross35 May 28, 2025
f869270
Auto merge of #141668 - tgross35:rollup-03gg6lf, r=tgross35
bors May 28, 2025
32f57ef
Merge from rustc
May 28, 2025
b43d184
coretests: simplify test_float macro to derive more things from the t…
RalfJung May 26, 2025
2303f50
coretests: add abs() and copysign() tests, and remove now-unnecessary…
RalfJung May 26, 2025
6addddd
float: Disable `total_cmp` sNaN tests for `f16`
tgross35 May 28, 2025
f20c139
Revert "increase perf of charsearcher for single ascii characters"
Kobzol May 28, 2025
4ad0897
Test(fs): Fix test_eq_windows_file_type for Windows 7
PaulDance May 16, 2025
d656b3b
Do not move thread-locals before dropping
orlp May 28, 2025
0f5484c
Improve safety comment, double-drop is not relevant here
orlp May 28, 2025
33bd15e
Add diagnostic items to sys::Mutex
Patrick-6 May 28, 2025
f5e3a6b
Make pthread Mutex internals less public
Patrick-6 May 28, 2025
e2a7b41
core: unstably expose atomic_compare_exchange so stdarch can use it
RalfJung May 28, 2025
0f9ab19
Rollup merge of #140369 - jplatte:mutex-rwlock-data-ptr, r=Amanieu
tgross35 May 28, 2025
dcb11c4
Rollup merge of #140697 - Sa4dUs:split-autodiff, r=ZuseZ4
tgross35 May 28, 2025
c31c5a2
Do not panic, maintain old behavior
orlp May 28, 2025
6662b01
Add comments to diagnostic items
Patrick-6 May 28, 2025
a9056a5
Add same unsafe bound on get_or_init_slow
orlp May 28, 2025
d0d5d19
When replacing an old value we may not drop it in place
orlp May 28, 2025
8e60ea9
atomic_load intrinsic: use const generic parameter for ordering
RalfJung May 24, 2025
d74b4d5
Add `loongarch64` with `d` feature to `f32::midpoint` fast path
heiher May 24, 2025
c11f2d3
Rollup merge of #141104 - PaulDance:fix-win7-test_eq_windows_file_typ…
jhpratt May 29, 2025
b5bafca
Rollup merge of #141477 - tshepang:patch-1, r=ChrisDenton
jhpratt May 29, 2025
683758c
Rollup merge of #141533 - RalfJung:rintf, r=bjorn3
jhpratt May 29, 2025
593dd85
Rollup merge of #141612 - jhpratt:phantom-docs, r=tgross35
jhpratt May 29, 2025
cbbddf6
Rollup merge of #141687 - RalfJung:atomic_compare_exchange, r=bjorn3
jhpratt May 29, 2025
835b73c
Rollup merge of #141690 - Patrick-6:intercept-mutex, r=m-ou-se
jhpratt May 29, 2025
45278f6
Rollup merge of #139994 - tamird:cstr-display, r=Amanieu
jhpratt May 29, 2025
8353439
Rollup merge of #141571 - RalfJung:float-tests, r=tgross35
jhpratt May 29, 2025
3be7537
Auto merge of #141717 - jhpratt:rollup-neu8nzl, r=jhpratt
bors May 29, 2025
4d6712b
Merge from rustc
RalfJung May 29, 2025
96897df
Auto merge of #141595 - bjorn3:rustc_no_sysroot_proc_macro, r=onur-ozkan
bors May 29, 2025
836dc3b
Make `std/src/num` mirror `core/src/num`
tgross35 Feb 25, 2025
6822c1d
Rollup merge of #141676 - tgross35:f16-disable-total-cmp, r=workingju…
GuillaumeGomez May 29, 2025
9f9af6d
Rollup merge of #141715 - heiher:loong64-f32-midpoint, r=the8472
GuillaumeGomez May 29, 2025
33bd4fe
float: Use a shared `assert_biteq!` macro for tests
tgross35 May 28, 2025
8abf798
float: Replace some approximate assertions with exact
tgross35 May 28, 2025
db986a8
float: Enable some f16 and f128 rounding tests on miri
tgross35 May 29, 2025
b8cc0a4
float: Use `assert_biteq!` where possible
tgross35 May 29, 2025
14c399c
Auto merge of #141739 - GuillaumeGomez:rollup-ivboqwd, r=GuillaumeGomez
bors May 29, 2025
5000d3f
Rollup merge of #141507 - RalfJung:atomic-intrinsics, r=bjorn3
matthiaskrgr May 30, 2025
c7ac933
Rollup merge of #141669 - tgross35:float-test-cleanup, r=RalfJung
matthiaskrgr May 30, 2025
6457f4d
Address review comments.
orlp May 30, 2025
98b2c3b
Update `compiler-builtins` to 0.1.160
tgross35 May 6, 2025
2dd64b3
`slice.get(i)` should use a slice projection in MIR, like `slice[i]` …
scottmcm Mar 29, 2025
7c34f44
Rollup merge of #140825 - rs-sac:ext, r=workingjubilee
workingjubilee May 30, 2025
5410daa
Rollup merge of #141237 - Qelxiros:139911-exact-div, r=workingjubilee
workingjubilee May 30, 2025
01b9130
Rollup merge of #141609 - lolbinarycat:core-dedup-ptr-docs-139190, r=…
workingjubilee May 30, 2025
c74beb7
std: clarify Clone trait documentation about duplication semantics
xizheyin May 18, 2025
11b7a2c
Merge from rustc
May 31, 2025
837884a
Auto merge of #141678 - Kobzol:revert-141516, r=workingjubilee
bors May 31, 2025
561cbc4
std: note that `std::str::from_utf8*` functions are aliases to `std::…
xizheyin May 17, 2025
e5b54e6
Auto merge of #141685 - orlp:inplace-tls-drop, r=joboet
bors May 31, 2025
451801b
Rollup merge of #141112 - xizheyin:issue-141079, r=Mark-Simulacrum
matthiaskrgr May 31, 2025
91b5394
Rollup merge of #141805 - tgross35:update-builtins, r=tgross35
matthiaskrgr May 31, 2025
999a8cc
Auto merge of #141824 - matthiaskrgr:rollup-7nffwd0, r=matthiaskrgr
bors May 31, 2025
0da4f84
Add const support for float rounding methods
ruancomelli May 19, 2025
f2b17b4
terminology: allocated object → allocation
RalfJung May 18, 2025
35a99da
library: explain TOCTOU races in `fs::remove_dir_all`
workingjubilee May 2, 2025
d89e96d
Auto merge of #139118 - scottmcm:slice-get-unchecked-intrinsic, r=wor…
bors May 31, 2025
a336f8d
Rollup merge of #141072 - Rynibami:stabilize-const-result-flatten, r=…
jhpratt May 31, 2025
d65c6a8
Rollup merge of #141215 - xizheyin:issue-141138, r=workingjubilee
jhpratt May 31, 2025
541e9d7
Rollup merge of #141521 - ruancomelli:const-float-rounding, r=RalfJung
jhpratt May 31, 2025
e1a3925
Rollup merge of #141832 - workingjubilee:explain-what-toctou-races-ar…
jhpratt May 31, 2025
60374c4
Auto merge of #141842 - jhpratt:rollup-r7ldrl2, r=jhpratt
bors Jun 1, 2025
256ab94
Merge from rustc
Jun 1, 2025
36d2c9c
Rollup merge of #141224 - RalfJung:no-objects, r=traviscross
GuillaumeGomez Jun 1, 2025
513fc8f
Auto merge of #141869 - GuillaumeGomez:rollup-vicg807, r=GuillaumeGomez
bors Jun 1, 2025
1ba12aa
Merge from 99e7c15e81385b38a8186b51edc4577d5d7b5bdd with conflicts
Jun 3, 2025
0759d3f
Update toolchain to 2025-06-02
Jun 3, 2025
62561a2
Update Kani version to ef6ad3b518676c3492ca5871ea61a441bb1d5b1e
Jun 3, 2025
a138d7e
Resolve conflicts
tautschnig Jun 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion library/alloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ bench = false
[dependencies]
core = { path = "../core", public = true }
safety = { path = "../contracts/safety" }
compiler_builtins = { version = "=0.1.159", features = ['rustc-dep-of-std'] }
compiler_builtins = { version = "=0.1.160", features = ['rustc-dep-of-std'] }

[features]
compiler-builtins-mem = ['compiler_builtins/mem']
Expand Down
62 changes: 48 additions & 14 deletions library/alloc/src/collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
K: Ord,
F: FnMut(&K, &mut V) -> bool,
{
self.extract_if(|k, v| !f(k, v)).for_each(drop);
self.extract_if(.., |k, v| !f(k, v)).for_each(drop);
}

/// Moves all elements from `other` into `self`, leaving `other` empty.
Expand Down Expand Up @@ -1397,7 +1397,7 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
}
}

/// Creates an iterator that visits all elements (key-value pairs) in
/// Creates an iterator that visits elements (key-value pairs) in the specified range in
/// ascending key order and uses a closure to determine if an element
/// should be removed.
///
Expand All @@ -1423,33 +1423,42 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
/// use std::collections::BTreeMap;
///
/// let mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x)).collect();
/// let evens: BTreeMap<_, _> = map.extract_if(|k, _v| k % 2 == 0).collect();
/// let evens: BTreeMap<_, _> = map.extract_if(.., |k, _v| k % 2 == 0).collect();
/// let odds = map;
/// assert_eq!(evens.keys().copied().collect::<Vec<_>>(), [0, 2, 4, 6]);
/// assert_eq!(odds.keys().copied().collect::<Vec<_>>(), [1, 3, 5, 7]);
///
/// let mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x)).collect();
/// let low: BTreeMap<_, _> = map.extract_if(0..4, |_k, _v| true).collect();
/// let high = map;
/// assert_eq!(low.keys().copied().collect::<Vec<_>>(), [0, 1, 2, 3]);
/// assert_eq!(high.keys().copied().collect::<Vec<_>>(), [4, 5, 6, 7]);
/// ```
#[unstable(feature = "btree_extract_if", issue = "70530")]
pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, K, V, F, A>
pub fn extract_if<F, R>(&mut self, range: R, pred: F) -> ExtractIf<'_, K, V, R, F, A>
where
K: Ord,
R: RangeBounds<K>,
F: FnMut(&K, &mut V) -> bool,
{
let (inner, alloc) = self.extract_if_inner();
let (inner, alloc) = self.extract_if_inner(range);
ExtractIf { pred, inner, alloc }
}

pub(super) fn extract_if_inner(&mut self) -> (ExtractIfInner<'_, K, V>, A)
pub(super) fn extract_if_inner<R>(&mut self, range: R) -> (ExtractIfInner<'_, K, V, R>, A)
where
K: Ord,
R: RangeBounds<K>,
{
if let Some(root) = self.root.as_mut() {
let (root, dormant_root) = DormantMutRef::new(root);
let front = root.borrow_mut().first_leaf_edge();
let first = root.borrow_mut().lower_bound(SearchBound::from_range(range.start_bound()));
(
ExtractIfInner {
length: &mut self.length,
dormant_root: Some(dormant_root),
cur_leaf_edge: Some(front),
cur_leaf_edge: Some(first),
range,
},
(*self.alloc).clone(),
)
Expand All @@ -1459,6 +1468,7 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
length: &mut self.length,
dormant_root: None,
cur_leaf_edge: None,
range,
},
(*self.alloc).clone(),
)
Expand Down Expand Up @@ -1917,18 +1927,19 @@ pub struct ExtractIf<
'a,
K,
V,
R,
F,
#[unstable(feature = "allocator_api", issue = "32838")] A: Allocator + Clone = Global,
> {
pred: F,
inner: ExtractIfInner<'a, K, V>,
inner: ExtractIfInner<'a, K, V, R>,
/// The BTreeMap will outlive this IntoIter so we don't care about drop order for `alloc`.
alloc: A,
}

/// Most of the implementation of ExtractIf are generic over the type
/// of the predicate, thus also serving for BTreeSet::ExtractIf.
pub(super) struct ExtractIfInner<'a, K, V> {
pub(super) struct ExtractIfInner<'a, K, V, R> {
/// Reference to the length field in the borrowed map, updated live.
length: &'a mut usize,
/// Buried reference to the root field in the borrowed map.
Expand All @@ -1938,10 +1949,13 @@ pub(super) struct ExtractIfInner<'a, K, V> {
/// Empty if the map has no root, if iteration went beyond the last leaf edge,
/// or if a panic occurred in the predicate.
cur_leaf_edge: Option<Handle<NodeRef<marker::Mut<'a>, K, V, marker::Leaf>, marker::Edge>>,
/// Range over which iteration was requested. We don't need the left side, but we
/// can't extract the right side without requiring K: Clone.
range: R,
}

#[unstable(feature = "btree_extract_if", issue = "70530")]
impl<K, V, F, A> fmt::Debug for ExtractIf<'_, K, V, F, A>
impl<K, V, R, F, A> fmt::Debug for ExtractIf<'_, K, V, R, F, A>
where
K: fmt::Debug,
V: fmt::Debug,
Expand All @@ -1953,8 +1967,10 @@ where
}

#[unstable(feature = "btree_extract_if", issue = "70530")]
impl<K, V, F, A: Allocator + Clone> Iterator for ExtractIf<'_, K, V, F, A>
impl<K, V, R, F, A: Allocator + Clone> Iterator for ExtractIf<'_, K, V, R, F, A>
where
K: PartialOrd,
R: RangeBounds<K>,
F: FnMut(&K, &mut V) -> bool,
{
type Item = (K, V);
Expand All @@ -1968,7 +1984,7 @@ where
}
}

impl<'a, K, V> ExtractIfInner<'a, K, V> {
impl<'a, K, V, R> ExtractIfInner<'a, K, V, R> {
/// Allow Debug implementations to predict the next element.
pub(super) fn peek(&self) -> Option<(&K, &V)> {
let edge = self.cur_leaf_edge.as_ref()?;
Expand All @@ -1978,10 +1994,22 @@ impl<'a, K, V> ExtractIfInner<'a, K, V> {
/// Implementation of a typical `ExtractIf::next` method, given the predicate.
pub(super) fn next<F, A: Allocator + Clone>(&mut self, pred: &mut F, alloc: A) -> Option<(K, V)>
where
K: PartialOrd,
R: RangeBounds<K>,
F: FnMut(&K, &mut V) -> bool,
{
while let Ok(mut kv) = self.cur_leaf_edge.take()?.next_kv() {
let (k, v) = kv.kv_mut();

// On creation, we navigated directly to the left bound, so we need only check the
// right bound here to decide whether to stop.
match self.range.end_bound() {
Bound::Included(ref end) if (*k).le(end) => (),
Bound::Excluded(ref end) if (*k).lt(end) => (),
Bound::Unbounded => (),
_ => return None,
}

if pred(k, v) {
*self.length -= 1;
let (kv, pos) = kv.remove_kv_tracking(
Expand Down Expand Up @@ -2013,7 +2041,13 @@ impl<'a, K, V> ExtractIfInner<'a, K, V> {
}

#[unstable(feature = "btree_extract_if", issue = "70530")]
impl<K, V, F> FusedIterator for ExtractIf<'_, K, V, F> where F: FnMut(&K, &mut V) -> bool {}
impl<K, V, R, F> FusedIterator for ExtractIf<'_, K, V, R, F>
where
K: PartialOrd,
R: RangeBounds<K>,
F: FnMut(&K, &mut V) -> bool,
{
}

#[stable(feature = "btree_range", since = "1.17.0")]
impl<'a, K, V> Iterator for Range<'a, K, V> {
Expand Down
Loading
Loading