Commit Graph

19149 Commits

Author SHA1 Message Date
Guillaume Gomez
5152ab2f5e
Rollup merge of #140734 - ivmarkov:master, r=joboet
Fix regression from #140393 for espidf / horizon / nuttx / vita

#140393 introduced changes to the layout of the `std::sys::process` code.
As a result, the Tier 3 ESP-IDF (and I suspect Horizon, Nuttx and Vita targets as well) no longer build.

A `pub use unsupported::output` is all that was missing - for the above OSes specifically. This explicit `pub use` is now necessary, because #140393 moved the `output` function to module-level, where it was previously part of `Command` and was thus re-exported automatically, as part of the `imp::Command` re-export further down the file containing the one-liner fix.

Note that - with the change introduced by #140393 - we **can't** anymore just do an unconditional `pub use imp::output` as this function simply does not exist anymore anywhere else but in the `unsupported` module.

r? `@joboet`
2025-05-07 18:19:08 +02:00
Guillaume Gomez
83e3d0e17b
Rollup merge of #140706 - GuillaumeGomez:fix-missing-temp-dir-cleanup, r=notriddle
[rustdoc] Ensure that temporary doctest folder is correctly removed even if doctests failed

Fixes #139899.

The bug was due to the fact that if any doctest fails for any reason, we call `exit` (or it's called inside `libtest` if not edition 2024), meaning that `TempDir`'s destructor isn't called, and therefore the temporary folder isn't cleaned up.

Took me a while to figure out how to reproduce but finally I was able to reproduce the bug with:

`````rust
#![doc(test(attr(deny(warnings))))]

//! ```
//! let a = 12;
//! ```
`````

And then I ensured that panicking doctests were cleaned up as well:

`````rust
//! ```
//! panic!();
//! ```
`````

And finally I checked if it was fixed for merged doctests too (`--edition 2024`).

To make this work, I needed to add a new public function in `libtest` too which would call a function once all tests have been run.

So only issue is: I have absolutely no idea how we can add a regression test for this fix. If anyone has an idea...

r? `@notriddle`
2025-05-07 18:19:07 +02:00
Guillaume Gomez
aca12a8216
Rollup merge of #140724 - tgross35:update-builtins, r=tgross35
Update `compiler-builtins` to 0.1.158

Includes the following changes:

* Require `target_has_atomic = "ptr"` for runtime feature detection [1]

[1]: https://github.com/rust-lang/compiler-builtins/pull/909
2025-05-07 10:50:50 +02:00
Guillaume Gomez
6e2c39b568
Rollup merge of #140398 - Berrysoft:cygwin-backtrace, r=tgross35
Fix backtrace for cygwin

Closes #140304

Depends on:
- [x] https://github.com/rust-lang/backtrace-rs/pull/704

This PR could not be merged until the above PR is merged. I'll update the submodule then.

EDIT: submodule updated.
2025-05-07 10:50:49 +02:00
ivmarkov
392880c004 Fix regression from #140393 for espidf / horizon / nuttx / vita 2025-05-07 08:04:21 +00:00
王宇逸
fe64184b16 Fix backtrace for cygwin 2025-05-07 13:08:19 +08:00
bors
891b852547 Auto merge of #140726 - jhpratt:rollup-b6oxopx, r=jhpratt
Rollup of 9 pull requests

Successful merges:

 - #134273 (de-stabilize bench attribute)
 - #139534 (Added support for `apxf` target feature)
 - #140419 (Move `in_external_macro` to `SyntaxContext`)
 - #140483 (Comment on `Rc` abort-guard strategy without naming unrelated fn)
 - #140607 (support duplicate entries in the opaque_type_storage)
 - #140656 (collect all Fuchsia bindings into the `fuchsia` module)
 - #140668 (Implement `VecDeque::truncate_front()`)
 - #140709 (rustdoc: remove unportable markdown lint and old parser)
 - #140713 (Structurally resolve in `check_ref_cast` in new solver)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-07 01:16:08 +00:00
Jacob Pratt
5b165aab89
Rollup merge of #140668 - vkrivopalov:vecdeque-truncate-front, r=jhpratt
Implement `VecDeque::truncate_front()`

Tracking issue: #140667
2025-05-07 00:29:24 +00:00
Jacob Pratt
fe97fe45f8
Rollup merge of #140656 - joboet:fuchsia_pal, r=workingjubilee
collect all Fuchsia bindings into the `fuchsia` module

The Fuchsia bindings are currently spread out across multiple modules in `sys/pal/unix` leading to unnecessary duplication. This PR moves all of these definitions into `sys::pal::unix::fuchsia` and additionally:
* deduplicates the definitions
* makes the error names consistent
* marks `zx_thread_self` and `zx_clock_get_monotonic` as safe extern functions
* removes unused items (there's no need to maintain these bindings if we're not going to use them)
* removes the documentation for the definitions (contributors should always consult the platform documentation, duplicating that here is just an extra maintenance burden)

`@rustbot` ping fuchsia
2025-05-07 00:29:24 +00:00
Jacob Pratt
25631ff093
Rollup merge of #140483 - baumanj:patch-1, r=workingjubilee
Comment on `Rc` abort-guard strategy without naming unrelated fn

`wrapped_add` is used, not `checked_add`, so avoid mentioning specific fn calls that may vary slightly based on "whatever produces the best code" and focus on things that will remain constant into the future.
2025-05-07 00:29:22 +00:00
Jacob Pratt
60a4b939a3
Rollup merge of #134273 - RalfJung:de-stabilize-bench, r=ibraheemdev,traviscross
de-stabilize bench attribute

This has been soft-unstable since forever (https://github.com/rust-lang/rust/pull/64066), and shown in future-compat reports since Rust 1.77 (https://github.com/rust-lang/rust/pull/116274).

The feature covering `bench` itself is tracked in https://github.com/rust-lang/rust/issues/50297, which has been closed despite still having active feature gates referencing it.

Cc `@rust-lang/libs-api`
2025-05-07 00:29:20 +00:00
Trevor Gross
4de822c3d2 Update compiler-builtins to 0.1.158
Includes the following changes:

* Require `target_has_atomic = "ptr"` for runtime feature detection

[1]: https://github.com/rust-lang/compiler-builtins/pull/909
2025-05-06 23:40:50 +00:00
bors
669c1ab967 Auto merge of #140514 - m-ou-se:proc-macro-span-file, r=Amanieu
Stabilize proc_macro::Span::{file, local_file}.

Stabilizes this part of https://github.com/rust-lang/rust/issues/54725:

```rust
impl Span {
    pub fn file(&self) -> String; // Mapped/artificial file name, for display purposes.

    pub fn local_file(&self) -> Option<PathBuf>; // Real file name as it exists on the local file system.
}
```

See also the naming discussion in https://github.com/rust-lang/rust/issues/139903
2025-05-06 22:03:11 +00:00
Jon Bauman
6a4af821b0
Update rc.rs docs
Update comment per review feedback
2025-05-06 13:19:42 -07:00
Guillaume Gomez
8929f8a180
Rollup merge of #136183 - hkBst:patch-25, r=Amanieu
Update iterator.rs to use arrays by value

Update examples to no longer avoid iterating arrays for #84513
2025-05-06 19:27:38 +02:00
Guillaume Gomez
14782ad687 Add new test_main_with_exit_callback public function in libtest to allow a callback to be called before exiting 2025-05-06 18:17:48 +02:00
Marijn Schouten
18a3599fe3 Update iterator.rs to use arrays by value
Update examples to no longer avoid iterating arrays for #84513
2025-05-06 12:19:24 +00:00
Stuart Cook
6238555e72
Rollup merge of #140598 - ShE3py:iter-misc-docs, r=workingjubilee
Steer docs to `utf8_chunks` and `Iterator::take`

- Adds `limit` as an alias of `take` (as this is [what Java calls this operation](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#limit-long-));
- Says that [`Utf8Chunks`](https://doc.rust-lang.org/std/str/struct.Utf8Chunks.html) comes from [`[u8]::utf8_chunks`](https://doc.rust-lang.org/std/primitive.slice.html#method.utf8_chunks).

``@rustbot`` label +A-docs
2025-05-06 16:28:41 +10:00
Stuart Cook
7cd7605277
Rollup merge of #140393 - joboet:sys_common_process, r=thomcc
std: get rid of `sys_common::process`

Move the public `CommandEnvs` into the `process` module (and make it a wrapper type for an internal iterator type) and everything else into `sys::process` as per #117276.

Something went wrong with a force push, so I can't reopen #139020. This is unchanged from that PR, apart from a rebase.

r? ```@thomcc```
2025-05-06 16:28:40 +10:00
Stuart Cook
d5c09b4aa6
Rollup merge of #139773 - thaliaarchi:vec-into-iter-last, r=workingjubilee
Implement `Iterator::last` for `vec::IntoIter`

Avoid iterating everything when we have random access to the last element.
2025-05-06 16:28:39 +10:00
Stuart Cook
5ca0053c79
Rollup merge of #139764 - dtolnay:extractif, r=Amanieu
Consistent trait bounds for ExtractIf Debug impls

Closes #137654. Refer to that issue for a table of the **4** different impl signatures we previously had in the standard library for Debug impls of various ExtractIf iterator types.

The one we are standardizing on is the one so far only used by `alloc::collections::linked_list::ExtractIf`, which is _no_ `F: Debug` bound, _no_ `F: FnMut` bound, only `T: Debug` bound.

This PR applies the following signature changes:

```diff
/* alloc::collections::btree_map */

    pub struct ExtractIf<'a, K, V, F, A = Global>
    where
-       F: 'a + FnMut(&K, &mut V) -> bool,
        Allocator + Clone,

    impl Debug for ExtractIf<'a, K, V, F,
+       A,
    >
    where
        K: Debug,
        V: Debug,
-       F: FnMut(&K, &mut V) -> bool,
+       A: Allocator + Clone,
```

```diff
/* alloc::collections::btree_set */

    pub struct ExtractIf<'a, T, F, A = Global>
    where
-       T: 'a,
-       F: 'a + FnMut(&T) -> bool,
        Allocator + Clone,

    impl Debug for ExtractIf<'a, T, F, A>
    where
        T: Debug,
-       F: FnMut(&T) -> bool,
        A: Allocator + Clone,
```

```diff
/* alloc::collections::linked_list */

    impl Debug for ExtractIf<'a, T, F,
+       A,
    >
    where
        T: Debug,
+       A: Allocator,
```

```diff
/* alloc::vec */

    impl Debug for ExtractIf<'a, T, F, A>
    where
        T: Debug,
-       F: Debug,
        A: Allocator,
-       A: Debug,
```

```diff
/* std::collections::hash_map */

    pub struct ExtractIf<'a, K, V, F>
    where
-       F: FnMut(&K, &mut V) -> bool,

    impl Debug for ExtractIf<'a, K, V, F>
    where
+       K: Debug,
+       V: Debug,
-       F: FnMut(&K, &mut V) -> bool,
```

```diff
/* std::collections::hash_set */

    pub struct ExtractIf<'a, T, F>
    where
-       F: FnMut(&T) -> bool,

    impl Debug for ExtractIf<'a, T, F>
    where
+       T: Debug,
-       F: FnMut(&T) -> bool,
```

I have made the following changes to bring these types into better alignment with one another.

- Delete `F: Debug` bounds. These are especially problematic because Rust closures do not come with a Debug impl, rendering the impl useless.

- Delete `A: Debug` bounds. Allocator parameters are unstable for now, but in the future this would become an API commitment that we do not debug-print a representation of the allocator when printing an iterator.

- Delete `F: FnMut` bounds. Requires `hashbrown` PR: https://github.com/rust-lang/hashbrown/pull/616. **API commitment:** we commit to not doing RefCell voodoo inside ExtractIf to have some way for its Debug impl (which takes &amp;self) to call a FnMut closure, if this is even possible.

- Add `T: Debug` bounds (or `K`/`V`), even on Debug impls that do not currently make use of them, but might in the future. **Breaking change.** Must backport into Rust 1.87 (current beta) or do a de-stabilization PR in beta to delay those types by one release.

- Render using `debug_struct` + `finish_non_exhaustive`, instead of `debug_tuple`.

- Do not render the _entire_ underlying collection.

- Show a "peek" field indicating the current position of the iterator.
2025-05-06 16:28:38 +10:00
David Tolnay
c35914383a
Consistent trait bounds for ExtractIf Debug impls 2025-05-05 19:46:46 -07:00
Vladimir Krivopalov
cdf4143eb8 Implement VecDeque::truncate_front()
Tracking issue: #140667

Signed-off-by: Vladimir Krivopalov <vladimir.krivopalov@gmail.com>
2025-05-05 11:13:26 -04:00
joboet
7845c011dd
collect all Fuchsia bindings into the fuchsia module
The Fuchsia bindings are currently spread out across multiple modules in `sys/pal/unix` leading to unnecessary duplication. This PR moves all of these definitions into `sys::pal::unix::fuchsia` and additionally:
* deduplicates the definitions
* makes the error names consistent
* marks some extern functions as safe
* removes unused items (there's no need to maintain these bindings if we're not going to use them)
* removes the documentation for the definitions (contributors should always consult the platform documentation, duplicating that here is just an extra maintenance burden)
2025-05-05 12:16:40 +02:00
bors
54d024e4bf Auto merge of #140650 - tgross35:rollup-0mp4h1s, r=tgross35
Rollup of 4 pull requests

Successful merges:

 - #135734 (Correct `extract_if` sample equivalent.)
 - #140307 (Refactor rustc_on_unimplemented's filter parser)
 - #140644 (Revert "Avoid unused clones in Cloned<I> and Copied<I>")
 - #140648 (Update `compiler-builtins` to 0.1.157)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-05 05:24:37 +00:00
Trevor Gross
512dab0bee
Rollup merge of #140648 - tgross35:update-builtins, r=tgross35
Update `compiler-builtins` to 0.1.157

Includes the following changes:

* Use runtime feature detection for fma routines on x86 [1]

Fixes: https://github.com/rust-lang/rust/issues/140452

[1]: https://github.com/rust-lang/compiler-builtins/pull/896
2025-05-05 00:20:58 -04:00
Trevor Gross
cac28ed674
Rollup merge of #140644 - the8472:revert-copy-clone-adapters, r=Mark-Simulacrum
Revert "Avoid unused clones in Cloned<I> and Copied<I>"

Per libs decision in https://github.com/rust-lang/rust/issues/140207#issuecomment-2842996190 this reverts commit ed5f31ab01 (#139745)
2025-05-05 00:20:58 -04:00
Trevor Gross
c44e1d65f3
Rollup merge of #135734 - nk9:extract_if-doc-equivalent, r=tgross35
Correct `extract_if` sample equivalent.

Tracking issue: https://github.com/rust-lang/rust/issues/43244

Original PR: #133265

The sample code marked as equivalent in the doc comment isn't currently equivalent. Given the same predicate and range, if your vector were `[1, 2, 3, 3, 3, 3, 3, 3, 4, 5, 6]`, then all of the 3s would be removed. `i` is only incremented when an element is dropped, but `range.end` is unchanged, so the items shift down. I got very confused when reading the docs and trying to square this sample code with the explanation of how the function works.

Fortunately, the real `extract_if()` does not have this problem. I've added an `end` variable to align the behavior. I've also taken the opportunity to simplify the predicate, which now just matches odd numbers, and to pad out the vec of numbers to line up the zero-indexed range with the integers in the vec.

r? the8472
2025-05-05 00:20:57 -04:00
bors
cd55868a8d Auto merge of #140353 - rust-lang:cargo_update, r=Mark-Simulacrum
Weekly `cargo update`

Automation to keep dependencies in `Cargo.lock` current.

The following is the output from `cargo update`:

```txt

compiler & tools dependencies:
     Locking 36 packages to latest compatible versions
    Updating addr2line v0.21.0 -> v0.24.2
    Updating anyhow v1.0.97 -> v1.0.98
    Updating askama v0.13.0 -> v0.13.1 (available: v0.14.0)
    Updating askama_derive v0.13.0 -> v0.13.1
    Updating backtrace v0.3.71 -> v0.3.74
    Updating blake3 v1.8.1 -> v1.8.2
    Updating chrono v0.4.40 -> v0.4.41
    Updating clap v4.5.36 -> v4.5.37
    Updating clap_builder v4.5.36 -> v4.5.37
    Updating color-eyre v0.6.3 -> v0.6.4
    Updating color-spantrace v0.2.1 -> v0.2.2
    Updating derive-where v1.2.7 -> v1.4.0
    Updating getrandom v0.2.15 -> v0.2.16
    Removing gimli v0.28.1
    Updating hashbrown v0.15.2 -> v0.15.3
    Updating jiff v0.2.6 -> v0.2.12
    Updating jiff-static v0.2.6 -> v0.2.12
    Updating libm v0.2.11 -> v0.2.13
    Removing object v0.32.2
    Updating openssl-sys v0.9.107 -> v0.9.108
      Adding owo-colors v4.2.0
    Updating proc-macro2 v1.0.94 -> v1.0.95
    Updating psm v0.1.25 -> v0.1.26
    Updating rand v0.9.0 -> v0.9.1
    Updating redox_syscall v0.5.11 -> v0.5.12
    Updating rustix v1.0.5 -> v1.0.7
    Updating sha2 v0.10.8 -> v0.10.9
    Updating stacker v0.1.20 -> v0.1.21
    Updating syn v2.0.100 -> v2.0.101
    Updating synstructure v0.13.1 -> v0.13.2
    Updating toml_datetime v0.6.8 -> v0.6.9
      Adding windows v0.61.1
      Adding windows-collections v0.2.0
      Adding windows-future v0.2.0
      Adding windows-numerics v0.2.0
    Updating winnow v0.7.6 -> v0.7.9
    Updating zerocopy v0.8.24 -> v0.8.25
    Updating zerocopy-derive v0.8.24 -> v0.8.25
note: pass `--verbose` to see 33 unchanged dependencies behind latest

library dependencies:
     Locking 2 packages to latest compatible versions
    Removing allocator-api2 v0.2.21
    Updating hashbrown v0.15.2 -> v0.15.3
    Removing proc-macro2 v1.0.94
    Removing quote v1.0.40
    Updating rand v0.9.0 -> v0.9.1
    Removing syn v2.0.100
    Removing unicode-ident v1.0.18
    Removing zerocopy v0.8.24
    Removing zerocopy-derive v0.8.24
note: pass `--verbose` to see 3 unchanged dependencies behind latest

rustbook dependencies:
     Locking 31 packages to latest compatible versions
    Updating ammonia v4.0.0 -> v4.1.0
    Updating anyhow v1.0.97 -> v1.0.98
    Updating cc v1.2.19 -> v1.2.21
    Updating chrono v0.4.40 -> v0.4.41
    Updating clap v4.5.36 -> v4.5.37
    Updating clap_builder v4.5.36 -> v4.5.37
    Updating clap_complete v4.5.47 -> v4.5.48
      Adding cssparser v0.35.0
      Adding cssparser-macros v0.6.1
      Adding dtoa v1.0.10
      Adding dtoa-short v0.3.5
    Updating hashbrown v0.15.2 -> v0.15.3
    Updating html5ever v0.27.0 -> v0.31.0
    Updating jiff v0.2.6 -> v0.2.12
    Updating jiff-static v0.2.6 -> v0.2.12
    Updating libc v0.2.171 -> v0.2.172
    Updating markup5ever v0.12.1 -> v0.16.1
      Adding match_token v0.1.0
      Adding phf_macros v0.11.3
    Updating proc-macro2 v1.0.94 -> v1.0.95
    Updating redox_syscall v0.5.11 -> v0.5.12
    Updating rustix v1.0.5 -> v1.0.7
    Updating sha2 v0.10.8 -> v0.10.9
    Updating syn v2.0.100 -> v2.0.101
    Updating synstructure v0.13.1 -> v0.13.2
    Updating toml v0.8.20 -> v0.8.22
    Updating toml_datetime v0.6.8 -> v0.6.9
    Updating toml_edit v0.22.24 -> v0.22.26
      Adding toml_write v0.1.1
      Adding web_atoms v0.1.1
    Updating winnow v0.7.6 -> v0.7.9
```
2025-05-05 02:11:37 +00:00
Trevor Gross
435fc7d685 Update compiler-builtins to 0.1.157
Includes the following changes:

* Use runtime feature detection for fma routines on x86 [1]

Fixes: https://github.com/rust-lang/rust/issues/140452

[1]: https://github.com/rust-lang/compiler-builtins/pull/896
2025-05-04 22:54:55 +00:00
Nick Kocharhook
52d806a7c0 extract_if's sample equivalent now really equivalent.
Simpler predicate.
Compare sample code output to that of the library function.
2025-05-04 23:38:54 +01:00
Trevor Gross
760d8daaea
Rollup merge of #140625 - paolobarbolini:vec-extract-if-alt-is-retain_mut, r=Mark-Simulacrum
Suggest `retain_mut` over `retain` as `Vec::extract_if` alternative

The docs for `Vec::extract_if` suggest using `Vec::retain` if the user doesn't need the removed item. Given that `extract_if` gives a mutable reference to the evaluated element, `retain_mut` is the most appropriate alternative, not `retain`.
2025-05-04 18:11:49 -04:00
Trevor Gross
fcb9da597a
Rollup merge of #137280 - RalfJung:const_swap_nonoverlapping, r=lcnr
stabilize ptr::swap_nonoverlapping in const

Closes https://github.com/rust-lang/rust/issues/133668

The blocking issue mentioned there is resolved by documentation. We may in the future actually support such code, but that is blocked on https://github.com/rust-lang/const-eval/issues/72 which is non-trivial to implement. Meanwhile, this completes stabilization of all `const fn` in `ptr`. :)

Here's a version of the problematic example to play around with:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=6c390452379fb593e109b8f8ee854d2a

Should be FCP'd with both `@rust-lang/libs-api`  and `@rust-lang/lang`  since  `swap_nonoverlapping` is documented to work as an "untyped" operation but due to the limitation mentioned above, that's not entirely true during const evaluation. I expect this limitation will only be hit in niche corner cases, so the benefits of having this function work most of the time outweigh the downsides of users running into this problem. (Note that unsafe code could already hit this limitation before this PR by doing cursed pointer casts, but having it hidden inside `swap_nonoverlapping` feels a bit different.)
2025-05-04 18:11:47 -04:00
The 8472
e6030468dd Revert "Avoid unused clones in Cloned<I> and Copied<I>"
This reverts commit ed5f31ab01.
2025-05-04 22:29:57 +02:00
github-actions
78823fea21 cargo update
compiler & tools dependencies:
     Locking 36 packages to latest compatible versions
    Updating addr2line v0.21.0 -> v0.24.2
    Updating anyhow v1.0.97 -> v1.0.98
    Updating askama v0.13.0 -> v0.13.1 (available: v0.14.0)
    Updating askama_derive v0.13.0 -> v0.13.1
    Updating backtrace v0.3.71 -> v0.3.74
    Updating blake3 v1.8.1 -> v1.8.2
    Updating chrono v0.4.40 -> v0.4.41
    Updating clap v4.5.36 -> v4.5.37
    Updating clap_builder v4.5.36 -> v4.5.37
    Updating color-eyre v0.6.3 -> v0.6.4
    Updating color-spantrace v0.2.1 -> v0.2.2
    Updating derive-where v1.2.7 -> v1.4.0
    Updating getrandom v0.2.15 -> v0.2.16
    Removing gimli v0.28.1
    Updating hashbrown v0.15.2 -> v0.15.3
    Updating jiff v0.2.6 -> v0.2.12
    Updating jiff-static v0.2.6 -> v0.2.12
    Updating libm v0.2.11 -> v0.2.13
    Removing object v0.32.2
    Updating openssl-sys v0.9.107 -> v0.9.108
      Adding owo-colors v4.2.0
    Updating proc-macro2 v1.0.94 -> v1.0.95
    Updating psm v0.1.25 -> v0.1.26
    Updating rand v0.9.0 -> v0.9.1
    Updating redox_syscall v0.5.11 -> v0.5.12
    Updating rustix v1.0.5 -> v1.0.7
    Updating sha2 v0.10.8 -> v0.10.9
    Updating stacker v0.1.20 -> v0.1.21
    Updating syn v2.0.100 -> v2.0.101
    Updating synstructure v0.13.1 -> v0.13.2
    Updating toml_datetime v0.6.8 -> v0.6.9
      Adding windows v0.61.1
      Adding windows-collections v0.2.0
      Adding windows-future v0.2.0
      Adding windows-numerics v0.2.0
    Updating winnow v0.7.6 -> v0.7.9
    Updating zerocopy v0.8.24 -> v0.8.25
    Updating zerocopy-derive v0.8.24 -> v0.8.25
note: pass `--verbose` to see 33 unchanged dependencies behind latest

library dependencies:
     Locking 2 packages to latest compatible versions
    Removing allocator-api2 v0.2.21
    Updating hashbrown v0.15.2 -> v0.15.3
    Removing proc-macro2 v1.0.94
    Removing quote v1.0.40
    Updating rand v0.9.0 -> v0.9.1
    Removing syn v2.0.100
    Removing unicode-ident v1.0.18
    Removing zerocopy v0.8.24
    Removing zerocopy-derive v0.8.24
note: pass `--verbose` to see 3 unchanged dependencies behind latest

rustbook dependencies:
     Locking 31 packages to latest compatible versions
    Updating ammonia v4.0.0 -> v4.1.0
    Updating anyhow v1.0.97 -> v1.0.98
    Updating cc v1.2.19 -> v1.2.21
    Updating chrono v0.4.40 -> v0.4.41
    Updating clap v4.5.36 -> v4.5.37
    Updating clap_builder v4.5.36 -> v4.5.37
    Updating clap_complete v4.5.47 -> v4.5.48
      Adding cssparser v0.35.0
      Adding cssparser-macros v0.6.1
      Adding dtoa v1.0.10
      Adding dtoa-short v0.3.5
    Updating hashbrown v0.15.2 -> v0.15.3
    Updating html5ever v0.27.0 -> v0.31.0
    Updating jiff v0.2.6 -> v0.2.12
    Updating jiff-static v0.2.6 -> v0.2.12
    Updating libc v0.2.171 -> v0.2.172
    Updating markup5ever v0.12.1 -> v0.16.1
      Adding match_token v0.1.0
      Adding phf_macros v0.11.3
    Updating proc-macro2 v1.0.94 -> v1.0.95
    Updating redox_syscall v0.5.11 -> v0.5.12
    Updating rustix v1.0.5 -> v1.0.7
    Updating sha2 v0.10.8 -> v0.10.9
    Updating syn v2.0.100 -> v2.0.101
    Updating synstructure v0.13.1 -> v0.13.2
    Updating toml v0.8.20 -> v0.8.22
    Updating toml_datetime v0.6.8 -> v0.6.9
    Updating toml_edit v0.22.24 -> v0.22.26
      Adding toml_write v0.1.1
      Adding web_atoms v0.1.1
    Updating winnow v0.7.6 -> v0.7.9
2025-05-04 00:25:46 +00:00
Paolo Barbolini
5cbb27ff90 Suggest retain_mut over retain as Vec::extract_if alternative 2025-05-03 16:39:47 +00:00
Matthias Krüger
2820bdb740
Rollup merge of #140595 - lolbinarycat:std-set_permissions-typo, r=cuviper
doc(std): fix typo lchown -> lchmod

chown is irrelevant here, as this function does not affect file ownership.  chmod is the correct function to reference here.
2025-05-03 12:44:36 +02:00
Matthias Krüger
422dfe6772
Rollup merge of #140564 - ebkalderon:use-present-indicative-in-std-io-pipe-docs, r=tgross35
Use present indicative tense in std::io::pipe() API docs

The inline documentation for all other free functions in the `std::io` module use the phrase "creates a" instead of "create a", except for the currently nightly-only `std::io::pipe()` function. This commit updates the text to align with the predominant wording in the `std::io` module.

I recognize this PR is quite a minuscule nitpick, so feel free to ignore and close if you disagree and/or there are bigger fish to fry. Thanks in advance! 😄

Relates to https://github.com/rust-lang/rust/issues/127154.
2025-05-03 08:45:04 +02:00
Matthias Krüger
69e0844a46
Rollup merge of #139343 - cberner:filelock_wouldblock, r=workingjubilee
Change signature of File::try_lock and File::try_lock_shared

These methods now return Result<(), TryLockError> instead of Result<bool, Error> to make their use less errorprone

These methods are unstable under the "file_lock" feature. The related tracking issue is https://github.com/rust-lang/rust/pull/130999 and this PR changes the signatures as discussed by libs-api: https://github.com/rust-lang/rust/issues/130994#issuecomment-2770838848
2025-05-03 08:45:01 +02:00
Thalia Archibald
cbdd7134ff Implement Iterator::last for vec::IntoIter 2025-05-02 20:08:28 -07:00
Lieselotte
415a73e3eb
docs: alias limit to Iterator::take, cite [u8]::utf8_chunks in Utf8Chunks 2025-05-02 23:41:52 +02:00
Matthias Krüger
15f21f43b3
Rollup merge of #140550 - Amanieu:stabilize_select_unpredictable, r=workingjubilee
Stabilize `select_unpredictable`

FCP completed in tracking issue #133962.
2025-05-02 19:37:59 +02:00
Matthias Krüger
06599db9c1
Rollup merge of #140536 - zachs18:mapped-guard-filter-map, r=Amanieu
Rename `*Guard::try_map` to `filter_map`.

Rename `std::sync::*Guard::try_map` to `filter_map`.

1. Analogous to `std::cell::Ref(Mut)::filter_map`.
2. Doesn't imply `Try` genericizability.

r? `@Amanieu` (or other T-libs-api)

Tracking issue for `mapped_lock_guards`: https://github.com/rust-lang/rust/issues/117108
2025-05-02 19:37:58 +02:00
binarycat
b7c933a495 doc(std): fix typo lchown -> lchmod 2025-05-02 12:13:40 -05:00
Stuart Cook
27d419a6b5
Rollup merge of #140389 - sayantn:avx512fp16, r=Amanieu
Remove `avx512dq` and `avx512vl` implication for `avx512fp16`

According to Intel, `avx512fp16` requires only `avx512bw`, but LLVM also enables `avx512vl` and `avx512dq` when `avx512fp16` is active. This is relic code, and will be fixed in LLVM soon. We should remove this from Rust too asap, especially before the stabilization of AVX512

Related:
 - llvm/llvm-project#136209
 - #138940
 - rust-lang/stdarch#1781
 - #111137

``@rustbot`` label O-x86_64 O-x86_32 A-SIMD A-target-feature T-compiler -T-libs
r? ``@Amanieu``

**Update: the LLVM fix has been merged**

cc ``@rust-lang/wg-llvm`` will it be possible to update the rustc llvm version to something after llvm/llvm-project#137450
2025-05-02 22:17:02 +10:00
Stuart Cook
30e556e772
Rollup merge of #140197 - ktnlvr:master, r=workingjubilee
Document breaking out of a named code block

Closes #110758.
2025-05-02 22:17:01 +10:00
Stuart Cook
5a58c7a6ab
Rollup merge of #140159 - thaliaarchi:pathbuf-extension, r=workingjubilee
Avoid redundant WTF-8 checks in `PathBuf`

Eliminate checks for WTF-8 boundaries in `PathBuf::set_extension` and `add_extension`, where joining WTF-8 surrogate halves is impossible. Don't convert the `str` to `OsStr`, because `OsString::push` specializes to skip the joining when given strings.

To assist in this, mark the internal methods `OsString::truncate` and `extend_from_slice` as `unsafe` to communicate their safety invariants better than with module privacy.

Similar to #137777.

cc `@joboet` `@ChrisDenton`
2025-05-02 22:17:00 +10:00
Stuart Cook
6fc78d410d
Rollup merge of #139847 - thaliaarchi:args/delegate-iter, r=workingjubilee
Delegate to inner `vec::IntoIter` from `env::ArgsOs`

Delegate from `std::env::ArgsOs` to the methods of the inner platform-specific iterators, when it would be more efficient than just using the default methods of its own impl. Most platforms use `vec::IntoIter` as the inner type, so prioritize delegating to the methods it provides.

`std::env::Args` is implemented atop `std::env::ArgsOs` and performs UTF-8 validation with a panic for invalid data. This is a visible effect which users certainly rely on, so we can't skip any arguments. Any further iterator methods would skip some elements, so no change is needed for that type.

Add `#[inline]` for any methods which simply wrap the inner iterator.
2025-05-02 22:17:00 +10:00
Stuart Cook
192fbcc83a
Rollup merge of #139608 - Lynnesbian:improve-async-block-docs, r=ibraheemdev
Clarify `async` block behaviour

Adds some documentation for control flow behaviour pertaining to `return` and `?` within `async` blocks. Fixes (or at least improves) #101444.

r? rust-lang/docs
2025-05-02 22:16:59 +10:00
Stuart Cook
8ffdb00d44
Rollup merge of #139206 - joboet:unique_thread_errno, r=ibraheemdev
std: use the address of `errno` to identify threads in `unique_thread_exit`

Getting the address of `errno` should be just as cheap as `pthread_self()` and avoids having to use the expensive `Mutex` logic because it always results in a pointer.
2025-05-02 22:16:59 +10:00