Commit Graph

28648 Commits

Author SHA1 Message Date
bors 4b9792692f Auto merge of #156589 - cuviper:revert-dbg-tearing, r=the8472
Revert tearing changes to `dbg!`

Since the primary change to `dbg!` in rust-lang/rust#149869, we've been chasing a few regressions:

* rust-lang/rust#153850, fixed by rust-lang/rust#154074
* rust-lang/rust#154988, fixed by rust-lang/rust#154994
* rust-lang/rust#155902, proposed fix in rust-lang/rust#155915

We already reverted this once, on beta only to prevent these regressions from shipping in 1.95.

In that most recent PR, we decided that it would be better to revert `dbg!` to its original state everywhere (`main` and 1.96-`beta`), and then we can consider it from scratch later. So here I've reverted the change and its fixes, but kept the regression tests, including the pending one.

cc @joboet @dianne @rust-lang/libs 
@rustbot label beta-nominated
2026-05-19 23:24:13 +00:00
bors ca9203f29c Auto merge of #156728 - JonathanBrouwer:rollup-Qv3EfnO, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#156146 (test new solver on CI until stabilization)
 - rust-lang/rust#155840 (prefer `T::IS_ZST` over manual check)
 - rust-lang/rust#156723 (Update books)
2026-05-18 21:25:18 +00:00
Jonathan Brouwer 27d3139405 Rollup merge of #155840 - Lars-Schumann:prefer-is-zst, r=clarfonthey
prefer `T::IS_ZST` over manual check

makes the intent clearer and possible small perf improvement
2026-05-18 23:17:17 +02:00
bors 9eb3be26b4 Auto merge of #156720 - JonathanBrouwer:rollup-vArjiS4, r=JonathanBrouwer
Rollup of 13 pull requests

Successful merges:

 - rust-lang/rust#156709 (stdarch subtree update)
 - rust-lang/rust#155006 (stabilize `feature(cfg_target_has_atomic_equal_alignment)`)
 - rust-lang/rust#156444 (Implement `OsStr::split_at`)
 - rust-lang/rust#156582 (Allow `global_asm!` in statement positions)
 - rust-lang/rust#156661 (Remove `UncheckedIterator`)
 - rust-lang/rust#152367 (Derives `Copy` for `ffi::FromBytesUntilNulError`)
 - rust-lang/rust#156443 (Fix invalid suggestion for parenthesized break)
 - rust-lang/rust#156606 (Add pext/pdep as aliases for extract_bits/deposit_bits)
 - rust-lang/rust#156630 (Replace `println!` with `assert!` in HashMap documentation examples)
 - rust-lang/rust#156644 (Widen the result of `widening_mul`.)
 - rust-lang/rust#156653 (Update `sysinfo` version to `0.39.2`)
 - rust-lang/rust#156697 (Add diagnostic items for IoBufReader and StdinLock)
 - rust-lang/rust#156704 (reduce usage of `box_patterns` in tests)
2026-05-18 18:00:20 +00:00
Jonathan Brouwer 4cce3530bb Rollup merge of #156697 - JaafarTanoukhi:iobufreader-stdinlock-diag-items, r=mejrs
Add diagnostic items for IoBufReader and StdinLock

Added two new diagnostic items for IoBufReader and StdinLock.
2026-05-18 17:07:13 +02:00
Jonathan Brouwer 3605c1f769 Rollup merge of #156644 - bjoernager:widening-mul, r=clarfonthey
Widen the result of `widening_mul`.

Tracking issue: rust-lang/rust#152016

This PR implements <https://github.com/rust-lang/rust/issues/152016#issuecomment-3843258926>, which mandates that `widening_mul` return a single, scalar value rather than a low/high tuple.

Consequently, this method is removed from `u128` and `i128` as they are the widest integral types. It has also been removed from `usize` and `isize` due to portability concerns.

Existing `widening_mul` usage has been replaced by equivalent calls to `carrying_mul` (which is logically identical to the old behaviour.) Existing &ndash; generic &ndash; non-doc tests have been removed.

# Public API

```rust
impl u8 {
    pub const fn widening_mul(self, rhs: Self) -> u16;
}

impl u16 {
    pub const fn widening_mul(self, rhs: Self) -> u32;
}

impl u32 {
    pub const fn widening_mul(self, rhs: Self) -> u64;
}

impl u64 {
    pub const fn widening_mul(self, rhs: Self) -> u128;
}

impl i8 {
    pub const fn widening_mul(self, rhs: Self) -> i16;
}

impl i16 {
    pub const fn widening_mul(self, rhs: Self) -> i32;
}

impl i32 {
    pub const fn widening_mul(self, rhs: Self) -> i64;
}

impl i64 {
    pub const fn widening_mul(self, rhs: Self) -> i128;
}
```
2026-05-18 17:07:11 +02:00
Jonathan Brouwer a26a65252f Rollup merge of #156630 - BowLuckie:main, r=clarfonthey
Replace `println!` with `assert!` in HashMap documentation examples

## Changes
- **`.keys()`**
- **`.values()`**
- **`.values_mut()`**
- **`.iter()`**
- **`.iter_mut()`**
2026-05-18 17:07:11 +02:00
Jonathan Brouwer 9333565661 Rollup merge of #156606 - niklasf:alias-pext-pdep, r=SimonSapin
Add pext/pdep as aliases for extract_bits/deposit_bits

So that the methods will be found when searching for the corresponding intrinsics.

Tracking issue for `extract_bits`/`deposit_bits`: https://github.com/rust-lang/rust/issues/149069
2026-05-18 17:07:10 +02:00
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
Jacob Pratt 3008421df2 Rollup merge of #156702 - emilyalbini:ea-qyuqlszrnltt, r=noratrieb
Update list of platforms vulnerable to TOCTOU in `remove_dir_all`

Neither platform can reasonably protect against TOCTOU in `remove_dir_all`:

* VxWorks doesn't always have the required API (depending on how it's built), and its security model prevents untrusted processes from existing.
* QNX itself is broken and prevents the use of `openat()`: in QNX 7.1, `O_NOFOLLOW` is straight up ignored, and in QNX 8.0 `openat()` works *but* there is a TOCTOU in the kernel itself.
2026-05-18 13:52:59 +02:00
Jacob Pratt d2c9c2849c Rollup merge of #156690 - joshtriplett:crate-aliases, r=SimonSapin
Add doc aliases for crate names whose functionality we've added

Add doc aliases for the names of crates whose functionality we've added to the
standard library.

This helps people find this functionality by crate name.
2026-05-18 13:52:58 +02:00
Emily Albini 23a860e713 update list of platforms vulnerable to TOCTOU 2026-05-18 11:34:48 +02:00
Gabriel Bjørnager Jensen 0a07235472 Widen 'widening_mul' result; Remove 'widening_mul' from 'u128' and 'i128'; 2026-05-18 11:21:16 +02:00
JafarTano 7905c8fd99 Add diagnostic items for IoBufReader and StdinLock 2026-05-18 11:14:17 +03:00
Josh Triplett 1c1aceb139 Add doc alias atty for is_terminal 2026-05-18 08:30:45 +02:00
Josh Triplett c3c12151e2 Add doc alias filetime for File::set_times 2026-05-18 08:30:33 +02:00
Josh Triplett 6780791cda Add doc alias home for home_dir 2026-05-18 08:30:21 +02:00
Josh Triplett 773ead250c Add doc alias memoffset for offset_of! 2026-05-18 08:30:10 +02:00
Josh Triplett 2acdb580b1 Add doc alias cfg-if for cfg_select! 2026-05-18 08:29:48 +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
Lars Schumann 6eefc1b28d prefer T::IS_ZST over manual check 2026-05-17 22:52:25 +00: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
Bowluckie 3e3baaf15e removed extra space after ///
at lines 495 and 558
2026-05-16 12:38:21 +10:00
Bowluckie 760b3f40bf fixed some bugs in hashmap documentation comments
`.keys()` was using `.values()` in the comment and 2 other functions were missing `use std::collections::HashMap`
2026-05-16 11:35:43 +10:00
Bowluckie 20f68aebb1 Updated map.rs functions to all use asserts instread of println! in documentations
Updated `.keys()`, `.values()`, `.iter()` and `.iter_mut()`. 

Instead of using print statements which shows no clear effect  by just reading the documentation
2026-05-16 11:04:33 +10:00
Bowluckie 4950a3c1a2 updated map.rs .values() method to use assert instead of println! 2026-05-16 10:35:30 +10: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
Niklas Fiekas 638a775642 Add pext/pdep as aliases for extract_bits/deposit_bits
So that the methods will be found when searching for the corresponding
intrinsics.

Tracking issue: https://github.com/rust-lang/rust/issues/149069
2026-05-15 14:57:24 +02:00