Commit Graph

28620 Commits

Author SHA1 Message Date
Jonathan Brouwer 18bedf4bc6 Rollup merge of #152367 - Conaclos:conaclos/FromBytesUntilNulError-impl-Copy, r=clarfonthey
Derives `Copy` for `ffi::FromBytesUntilNulError`

[`ffi::FromBytesWithNulError` derives `Copy` since Rust 1.93](https://github.com/rust-lang/rust/commit/2f5a3d4b06a0a9e8749c2e361758ec517df0c96a) while `ffi::FromBytesUntilNulError` doesn't.
This Pr fixes that by deriving `Copy` for `ffi::FromBytesUntilNulError`.

I encountered this issue while I was working in a const context.

Note: I couldn't find any documentation about what kind of PR is allowed. As this one is very small, I guess it is ok to submit it directly without opening an issue first?
2026-05-18 17:07:08 +02:00
Jonathan Brouwer 43de103116 Rollup merge of #156661 - theemathas:del-unchecked-iter, r=SimonSapin
Remove `UncheckedIterator`

The only remaining usage of `UncheckedIterator` was in `array::{try_,}from_trusted_iterator`. So, replace `array::repeat` and array's `Clone` impl with a manual `from_fn` call rather than going through unnecessary abstractions, and remove the `UncheckedIterator` trait.
2026-05-18 17:07:07 +02:00
Jonathan Brouwer a6138ec142 Rollup merge of #156444 - ChrisDenton:os_str_split_at, r=nia-e
Implement `OsStr::split_at`

See rust-lang/rust#156199

This allows splitting only on valid UTF-8 boundaries, regardless of the platform, which avoids cross-platform landmines.
2026-05-18 17:07:05 +02:00
Jonathan Brouwer 33d6fe7a9a Rollup merge of #155006 - WaffleLapkin:stabilize_cfg_target_has_atomic_equal_alignment, r=Urgau
stabilize `feature(cfg_target_has_atomic_equal_alignment)`

See stabilization report: https://github.com/rust-lang/rust/issues/93822#issuecomment-4192399374
cc @joshtriplett
2026-05-18 17:07:04 +02:00
Jonathan Brouwer 0deac0fc6c Rollup merge of #156709 - sayantn:stdarch-sync-2026-05-18, r=sayantn
stdarch subtree update

Subtree update of `stdarch` to https://github.com/rust-lang/stdarch/commit/bb24cbdaa541dd1ca7723d2e172a6c43582055f3.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-05-18 17:07:04 +02:00
bors 5ea817c65e Auto merge of #149696 - jnodorp:clarify-utf16-errors, r=SimonSapin
Clarify UTF-16 decoding errors

Fix UTF-16 error messages as suggested in rust-lang/rust#116258.
2026-05-18 04:49:52 +00:00
Jonathan Brouwer 3810819af3 Rollup merge of #156677 - Cheese-Space:main, r=SimonSapin
change `other uses of const` to `raw pointers` in const keyword docs

this section only talks about how `const` is used in raw pointers and doesn't give any other uses, so in my opinion it would be a bit clearer if the section was named `raw pointers` or something similar.
2026-05-18 03:19:51 +02:00
Jonathan Brouwer b295a02a4e Rollup merge of #156668 - joshtriplett:format-into-typo, r=SimonSapin
Fix typo in `format_into` docs: signed -> unsigned

The documentation for the `format_into` methods on unsigned integers
still said "in signed decimal format". Change them to say "unsigned".
2026-05-18 03:19:50 +02:00
Jonathan Brouwer 868afcb29b Rollup merge of #156647 - oscargus:fasterfloatmidpoint, r=SimonSapin
Change division to multiplication in floating-point midpoint

Multiplication is faster than division on most (all?) platforms. While the optimizer will handle this, there is really no point in relying on that. Using multiplication directly will not have any drawbacks and are numerically identical (in this case since 1.0 / 2.0 == 0.5)

Consider the examples at https://godbolt.org/z/oMvb9vobG where it is clear that the non-optimized version uses division, while the optimized version uses multiplication.
2026-05-18 03:19:49 +02:00
Jonathan Brouwer 0104cf008e Rollup merge of #156638 - FelixLttks:fix-espidf-sigkill, r=SimonSapin
library: Fix std compilation for espidf target in unix::process

Fixes a regression on the riscv32imac-esp-espidf target caused by commit 7bf5fe7bf8 (linked issue rust-lang/rust#156537) . The unix_kill_process_group feature attempts to use libc::SIGKILL, which is not supported on the espidf target.

Discussed in `esp-idf-sys` issue: https://github.com/esp-rs/esp-idf-sys/issues/419
2026-05-18 03:19:49 +02:00
Jonathan Brouwer a62fb3bfd7 Rollup merge of #156624 - lygstate:c_ffi_docs_fixes, r=SimonSapin
c ffi document fixes for c_short.md

There is no reference to `char` in c_short.md
2026-05-18 03:19:48 +02:00
Jonathan Brouwer a99602d456 Rollup merge of #156572 - xtqqczze:sound-env, r=SimonSapin
std: replace "safe" with "sound" in safety documentation

- `env::set_var`
- `env::remove_var`

Context: https://github.com/rust-lang/rust/pull/124636
2026-05-18 03:19:47 +02:00
Jonathan Brouwer 8ebe7e84bc Rollup merge of #156488 - justinyaodu:patch-2, r=SimonSapin
Fix missing period in Iterator product doc comment

It looks like the other doc comments all end with a period.
2026-05-18 03:19:47 +02:00
Jonathan Brouwer acd0707333 Rollup merge of #156234 - bend-n:into_array_for_vec_t_via_boxed_array, r=SimonSapin
implement `into_array` for `Vec<T>`

for more into_array coverage and to avoid harmful obtuse opaque try_into calls
2026-05-18 03:19:46 +02:00
Jonathan Brouwer 5908149302 Rollup merge of #155313 - numero-744:patch-1, r=SimonSapin
doc(core::cmp::Eq): fix definition of symmetry

The definition did not match the one from PartialEq
2026-05-18 03:19:45 +02:00
Jonathan Brouwer 05e9620f33 Rollup merge of #156492 - RalfJung:cfg-miri, r=SimonSapin
remove/update various cfg(miri)

I went over all `cfg(miri)` in `library/`. Most of the things I noticed have become separate PRs; these here are the few remaining scattered little fixes in various places.
2026-05-18 03:19:44 +02:00
Amanieu d'Antras d913db70df Merge pull request #2063 from sayantn/intrinsic-test
Redesign `intrinsic-test` to use simple comparison
2026-05-17 22:21:24 +00:00
Cheese_space 76955f4f2d change other uses of const to raw pointers 2026-05-17 22:52:56 +02:00
Josh Triplett 43436c9a77 Fix typo in format_into docs: signed -> unsigned
The documentation for the `format_into` methods on unsigned integers
still said "in signed decimal format". Change them to say "unsigned".
2026-05-17 15:16:01 +02:00
Tim (Theemathas Chirananthavat) ea703e28fc Remove UncheckedIterator
The last usage of this trait was removed in a previous commit.
2026-05-17 15:06:12 +07:00
Tim (Theemathas Chirananthavat) 62e595213d Remove array::{try_,}from_trusted_iterator
This is the only remaining place that uses `UncheckedIterator`. So,
replace `array::repeat` and array's `Clone` impl with a manual `from_fn`
call rather than going through unnecessary abstractions.

Removal of `UncheckedIterator` will be done in a later commit.
2026-05-17 14:33:59 +07:00
Oscar Gustafsson 267796532f Change division to multiplication in floating-point midpoint 2026-05-16 19:45:23 +02:00
FelixLttks 88eb204a7a Fix compilation for espidf target by conditionally disabling process group killing 2026-05-16 12:18:45 +02:00
Yonggang Luo 871a2ae050 c ffi document fixes for c_short.md
There is no reference to `char` in c_short.md
2026-05-16 06:00:48 +08:00
Jonathan Brouwer 845f3d30bf Rollup merge of #156556 - qaijuang:issue-156491-str-replace-utf8-pattern, r=ChrisDenton
Require UTF-8 in `Utf8Pattern::StringPattern`

Store `&str` instead, so the UTF-8 invariant is enforced at the API boundary.

Fixes rust-lang/rust#156491
2026-05-15 20:11:46 +02:00
Jonathan Brouwer ae98f76b1c Rollup merge of #156493 - RalfJung:run-temp-dir, r=ChrisDenton
actually run the temp_dir doctest

No idea why this currently doesn't get run.

That said, this might fail in Miri, so we may have to wait for https://github.com/rust-lang/miri/pull/5029.
2026-05-15 20:11:45 +02:00
bors 88ba7fbe0a Auto merge of #155360 - malezjaa:try_insert_changes, r=cuviper
map_try_insert changes





Made changes according to https://github.com/rust-lang/rust/issues/82766#issuecomment-4253028464.

r? @tgross35
2026-05-15 08:12:52 +00:00
Qai Juang 8909e794e7 Require UTF-8 in Utf8Pattern::StringPattern 2026-05-14 21:26:00 -04:00
Ralf Jung 9faff71e46 actually run the temp_dir doctest 2026-05-14 23:12:46 +02:00
malezjaa ca70543ca4 map_try_insert changes 2026-05-14 22:36:03 +02:00
xtqqczze 181845e3fc std: replace "safe" with "sound" in safety documentation 2026-05-14 13:43:33 +01:00
Chris Denton 921b35bb6d Implement OsStr::split_at 2026-05-14 06:08:58 +00:00
sayantn deaa5091fd Disable some tests in x86 due to CI failures 2026-05-14 09:54:33 +05:30
sayantn b13eb7790b Fix _mm_sm3rnds2_epi32 2026-05-14 09:54:33 +05:30
sayantn 0415e2fda7 Disable some assert_instr tests in big-endian 2026-05-14 09:54:33 +05:30
sayantn f09bf0bf51 gen-arm: toggle big_endian_inverse where required 2026-05-14 09:54:33 +05:30
sayantn 10f4190ce5 Modify the CI scripts to work with the new design 2026-05-14 09:54:33 +05:30
sayantn a5179d0f8a Make floats static, as rounding is not a real concern here anymore 2026-05-14 09:54:33 +05:30
sayantn 0962db67bc Use pointers for the C definitions to resolve ABI inconsistencies 2026-05-14 09:54:26 +05:30
sayantn ee0c01647d Generate rust bindings and test code 2026-05-14 09:54:21 +05:30
WANG Rui 35d77fbdd0 loongarch: Use intrinsics::simd for vpick{ev,od} 2026-05-13 22:50:25 +08:00
John Millikin 7bf5fe7bf8 Add ChildExt::kill_process_group
This function wraps POSIX `killpg(pid, SIGKILL)`, and on Linux
additionally may be implemented by `pidfd_send_signal`.
2026-05-13 22:39:57 +09:00
John Millikin 2c30279ff6 Add send_process_group_signal to existing unix_send_signal feature
This function wraps POSIX `killpg()`, and on Linux additionally
may be implemented by `pidfd_send_signal`.
2026-05-13 19:41:14 +09:00
Jonathan Brouwer ac656cbf21 Rollup merge of #156431 - bushrat011899:core_io_util, r=nia-e
Move `std::io::util` to `core::io`

ACP: https://github.com/rust-lang/libs-team/issues/755
Tracking issue: https://github.com/rust-lang/rust/issues/154046
Subset of: https://github.com/rust-lang/rust/pull/154684

## Description

Moves utility types and functions from `std::io::util` and `std::io` to `core::io`, leaving any IO trait implementations behind. They will be moved along with the traits themselves. Certain documentation links had to be amended.

- `Chain`
- `Empty`
- `Repeat`
- `Sink`
- `Take`
- `empty`
- `repeat`
- `sink`

---

## Notes

* This can be reviewed independently of the other PRs tracked in rust-lang/rust#154046.
* `Chain` and `Take` were previously in the main `mod.rs` file for `std::io`, but I've chosen to move them into the `util.rs` file in `core::io` instead. I think they make more sense in that file, but I'm happy to move them into `mod.rs` if that's a controversial decision.
* No AI tooling of any kind was used during the creation of this PR.
2026-05-12 18:53:37 +02:00
Jonathan Brouwer 5a38b67a02 Rollup merge of #156428 - bushrat011899:core_io_cursor, r=nia-e
Move `std::io::Cursor` to `core::io`

ACP: https://github.com/rust-lang/libs-team/issues/755
Tracking issue: https://github.com/rust-lang/rust/issues/154046
Subset of: https://github.com/rust-lang/rust/pull/154684

## Description

Moves `std::io::Cursor` to `core::io`, leaving the IO trait implementations behind. They will be moved along with the traits themselves. Certain documentation links had to be amended, and a private/unstable `into_parts_mut` method was added to allow the internals to remain private.

---

## Notes

* This can be reviewed independently of the other PRs tracked in rust-lang/rust#154046.
* No AI tooling of any kind was used during the creation of this PR.
2026-05-12 18:53:36 +02:00
Folkert de Vries 1458d8884f Merge pull request #2114 from heiher/vabsd
loongarch: Use `intrinsics::simd` for vabsd
2026-05-12 14:18:06 +00:00
Zac Harrold 5cbf9f8c8b Move std::io::util to core::io 2026-05-12 23:07:34 +10:00
Zac Harrold e9125c62b1 Move std::io::Cursor into core::io 2026-05-12 22:59:37 +10:00
Ralf Jung e91ca04c54 explain ignore aarch64 tests 2026-05-12 09:53:34 +02:00
Ralf Jung 4625f8ccbd remove/update various cfg(miri) 2026-05-12 09:50:48 +02:00