20059 Commits

Author SHA1 Message Date
Weihang Lo
8d17219da9
chore(toml): disable toml's default features, unless necessary (#15598)
### What does this PR try to resolve?

This reduces the build time of `cargo-util-schemas` by disabling the
unused `display` and `parse` features of `toml` (which are enabled by
default).

This is useful as `cargo-util-schemas` is intended to be reused outside
of Cargo.

### How should we test and review this PR?

As I believe these features only *feature-gate* items on `toml` (they do
not affect runtime behavior silently), the CI building successfully
should be enough to make sure this does not break anything. ~If this
does not build, I will try to tend to it today, otherwise feel free to
push to this branch.~
2025-05-25 14:46:55 +00:00
AudaciousAxiom
8362109b8e chore(toml): disable toml's default features, unless necessary
This reduces the build time of `cargo-util-schemas`.
2025-05-25 13:31:18 +02:00
Weihang Lo
4aa973480b
docs(README): fix the link to the changelog in the Cargo book (#15597)
<!--
Thanks for submitting a pull request 🎉! Here are some tips for you:

* If this is your first contribution, read "Cargo Contribution Guide"
first:
  https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to
review.
* If your idea is large and needs feedback from the community, read how:
  https://doc.crates.io/contrib/process/#working-on-large-features
* Cargo takes care of compatibility. Read our design principles:
  https://doc.crates.io/contrib/design.html
* When changing help text of cargo commands, follow the steps to
generate docs:

https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
* If your PR is not finished, set it as "draft" PR or add "WIP" in its
title.
* It's ok to use the CI resources to test your PR, but please don't
abuse them.

### What does this PR try to resolve?

Explain the motivation behind this change.
A clear overview along with an in-depth explanation are helpful.

You can use `Fixes #<issue number>` to associate this PR to an existing
issue.

### How should we test and review this PR?

Demonstrate how you test this change and guide reviewers through your
PR.
With a smooth review process, a pull request usually gets reviewed
quicker.

If you don't know how to write and run your tests, please read the
guide:
https://doc.crates.io/contrib/tests

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->
### What does this PR try to resolve?

When Cargo's changelog was moved into the book in #15123, it seems the
extension was left as `.md`, whereas the link should point to the
rendered version, which ends with `.html`.

### How should we test and review this PR?

Following the new link in the README's rendered view and observing that
it does indeed point to the changelog should be enough.
2025-05-25 10:42:48 +00:00
AudaciousAxiom
2243b6d5b6
docs(README): fix the link to the changelog in the Cargo book 2025-05-25 10:05:19 +00:00
Weihang Lo
f19321e343
Add the future edition (#15595)
This adds support for the "future" edition which was added to rustc in
https://github.com/rust-lang/rust/pull/137606.

To enable support for unstable editions, this introduces a new
`unstable-editions` cargo feature. The intent is that instead of having
a new feature for each edition that we reuse this feature for all new
editions. I don't see a particular reason we should have a separate one
for each edition, and this helps a bit with scalability and simplifies
some of the edition process.

This also includes a change to rework `supports_compat_lint` explained
in the comment.
2025-05-25 01:06:12 +00:00
Eric Huss
5f5ad05d80 Add the future edition
This adds support for the "future" edition which was added to rustc in
https://github.com/rust-lang/rust/pull/137606.

To enable support for unstable editions, this introduces a new
`unstable-editions` cargo feature. The intent is that instead of having
a new feature for each edition that we reuse this feature for all new
editions. I don't see a particular reason we should have a separate one
for each edition, and this helps a bit with scalability and simplifies
some of the edition process.

This also includes a change to rework `supports_compat_lint` explained
in the comment.
2025-05-24 17:36:32 -07:00
Weihang Lo
68db37499f
chore(gh): Add new-lint issue template (#15575)
### What does this PR try to resolve?

We aren't quite ready for writing lints (waiting on an annotate-snippets
release) but I wanted to start recording some lint ideas I had.

### How should we test and review this PR?

Based on clippy's which I assumed would be a good starting point. There
are more area we'll need to fill out during discussion, like the lint
name, what primary group the lint would be in, etc.

### Additional information
2025-05-22 14:27:15 +00:00
Ed Page
5661fb89c1 chore(gh): Add new-lint template
Based on clippy's
2025-05-22 08:42:14 -05:00
Weihang Lo
c2c636a6db
fix(toml): Remove workaround for rustc frontmatter support (#15570)
### What does this PR try to resolve?

With rust-lang/rust#140035 now merged, we can rely on that rather than
dirty hacks

This is part of #12207

### How should we test and review this PR?

### Additional information
2025-05-21 23:45:57 +00:00
Ed Page
f49d2fdbb4 fix(toml): Remove workaround for rustc frontmatter support
With rust-lang/rust#140035 now merged, we can rely on that rather than
dirty hacks
2025-05-21 12:48:56 -05:00
Ed Page
4b3f952307
fix(vendor)!: vendor files with .rej/.orig suffix (#15569)
### What does this PR try to resolve?

This is meant to fixes #13191

As git sources and registry sources are considered immutable.
I don't think there is any reason excluding those files.
There might be a little chance local Git repositories might have those,
though that is a rare use case.

Alternatively,
we could reject all `.rej`/`.orig` files but `Cargo.toml.orig`.

### How should we test and review this PR?

Test updates should be sufficient.

### Additional information

This is a follow-up of #15514
2025-05-21 17:48:12 +00:00
Weihang Lo
29ecb7f36a
fix(vendor)!: vendor files with .rej/.orig suffix
This is meant to fixes #13191

As git sources and registry sources are considered immutable.
I don't think there is any reason excluding those files.
There might be a little chance local Git repositories might have those,
though that is a rare use case.

Alternatively,
we could reject all `.rej`/`.orig` files but `Cargo.toml.orig`.
2025-05-21 13:17:16 -04:00
Weihang Lo
622d4c2506
test(vendor): make what to vendor clearer 2025-05-21 13:16:48 -04:00
Weihang Lo
dd4c8c0e2a
test(vendor): snapshot .cargo-checksum.json
So that it explicitly shows what we really vendor
2025-05-21 13:03:04 -04:00
Ed Page
ee08992ec9
fix(vendor)!: direct extraction for registry sources (#15514)
### What does this PR try to resolve?

`PathSource::list_files` has some heurstic rules for listing files.
Those rules are mainly designed for `cargo package`.

Previously, cargo-vendor relies on those rules to understand what files
to vendor. However, it shouldn't use those rules because:

* Package extracted from a `.crate` tarball isn't Git-controlled, some
rules may apply differently.
* The extracted package already went through `PathSource::list_files`
during packaging. It should be clean enough.
* Should keep crate sources from registry sources in a pristine state,
which is exactly what vendoring is meant for.

Instead, we switch to direct extraction into the vendor directory
to ensure source code is the same as in the `.crate` tarball.

### How should we test and review this PR?

There is already a test `vendor::package_exclude` for the fix of #9054,
though now I think it is not a good fix. The test change shows the
correct behavior change.

I am not sure if we want more tests.

Also, there are some caveats with this fix:

* The overwrite protection in `unpack_package` assumes the unpack
  directory is always `<pkg>-<version`>.
  We don't want to remove this,
  but for cargo-vendor supports vendoring without version suffix.
  For that case, we need a temporary staging area,
  and move the unpacked source then.
* The heurstic in `PathSource::list_files` did something "good" in
  general cases, like excluding hidden directories. That means
  common directories like `.github` or `.config` won't be vendored.
  After this, those get included. This is another round of churns.
  We might want to get other `cargo-vendor` changes along with this
  in one single release.

### Additional information

* Fixes #9054
* Fixes #9555
* Fixes #9575
* Fixes #11000
* Fixes #14034
* Fixes #15080
* Fixes #15090

This also opens a door for

* #10310
* #13191

Since we are changing vendored source (again), we might want to remove
the `.rej`/`.orig` special rules in cargo-vendor, as well as look into
the new source-dedup vendor dir layout.

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_SUMMARY_START -->

### Summary Notes

-
[benchmark-result](https://github.com/rust-lang/cargo/pull/15514#issuecomment-2870275766)
by [weihanglo](https://github.com/weihanglo)

Generated by triagebot, see
[help](https://forge.rust-lang.org/triagebot/note.html) for how to add
more
<!--
TRIAGEBOT_SUMMARY_DATA_START$${"entries_by_url":{"https://github.com/rust-lang/cargo/pull/15514#issuecomment-2870275766":{"title":"benchmark-result","comment_url":"https://github.com/rust-lang/cargo/pull/15514#issuecomment-2870275766","author":"weihanglo"}}}$$TRIAGEBOT_SUMMARY_DATA_END
-->

<!-- TRIAGEBOT_SUMMARY_END -->
<!-- TRIAGEBOT_END -->
2025-05-21 14:42:18 +00:00
Weihang Lo
c2d3bc48fc
fix(vendor): early Windows 10 versions cannot move dirs
Not sure if it is really needed,
though Cargo had better follow what platform support says.

> The behavior on Windows is the same on Windows 10 1607 and higher
> if `FileRenameInfoEx` is supported by the filesystem; otherwise,
> `from` can be anything, but `to` must *not* be a directory.

https://doc.rust-lang.org/1.86.0/src/std/fs.rs.html#2430-2435
2025-05-21 10:07:42 -04:00
Weihang Lo
dc304df0dc
fix(vendor): remove workaround for rust-lang/cargo#5956
By doing direct extractions, source code is kept in its original state
The old workaround is irrelevant now.
2025-05-21 10:07:42 -04:00
Weihang Lo
e8534d0bc2
fix(vendor)!: direct extraction for registry sources
`PathSource::list_files` has some heurstic rules for listing files.
Those rules are mainly designed for `cargo package`.

Previously, cargo-vendor relies on those rules to understand what
files to vendor. However, it shouldn't use those rules because:

* Package extracted from a `.crate` tarball isn't Git-controlled,
  some rules may apply differently.
* The extracted package already went through `PathSource::list_files`
  during packaging. It should be clean enough.
* Should keep crate sources from registry sources in a pristine state,
  which is exactly what vendoring is meant for.

Instead, we switch to direct extraction into the vendor directory
to ensure source code is the same as in the `.crate` tarball.

There are some caveats:

* The overwrite protection in `unpack_package` assumes the unpack
  directory is always `<pkg>-<version`>.
  We don't want to remove this,
  but for cargo-vendor supports vendoring without version suffix.
  For that case, we need a temporary staging area,
  and move the unpacked source then.
* The heurstic in `PathSource::list_files` did something "good" in
  general cases, like excluding hidden directories. That means
  common directorys like `.github` or `.config` won't be vendored.
  After this, those get included. This is another round of churns.
  We might want to get other `cargo-vendor` changes along with this
  in one single release.
2025-05-21 10:07:41 -04:00
Weihang Lo
060ab41ed8
refactor(vendor): extract vendor filter to a function 2025-05-21 10:07:41 -04:00
Weihang Lo
8fee50a9b8
refactor(vendor): name variables better 2025-05-21 10:07:41 -04:00
Weihang Lo
d760d6edf2
refactor(vendor): remove unnecessary allocations 2025-05-21 10:07:40 -04:00
Weihang Lo
a506cebfed
refactor(registry): extract the general unpack logic 2025-05-21 10:07:40 -04:00
Ed Page
2d662d919e
chore(deps): update msrv (1 version) to v1.87 (#15530)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [MSRV:1](https://redirect.github.com/rust-lang/rust) | minor | `1.86`
-> `1.87` |

---

### Release Notes

<details>
<summary>rust-lang/rust (MSRV:1)</summary>

###
[`v1.87`](https://redirect.github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1870-2025-05-15)

[Compare
Source](https://redirect.github.com/rust-lang/rust/compare/1.86.0...1.87.0)

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

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

## Language

- [Stabilize `asm_goto`
feature](https://redirect.github.com/rust-lang/rust/pull/133870)
- [Allow parsing open beginning ranges (`..EXPR`) after unary operators
`!`, `-`, and
`*`](https://redirect.github.com/rust-lang/rust/pull/134900).
- [Don't require method impls for methods with `Self: Sized` bounds in
`impl`s for unsized
types](https://redirect.github.com/rust-lang/rust/pull/135480)
- [Stabilize `feature(precise_capturing_in_traits)` allowing `use<...>`
bounds on return position `impl Trait` in
`trait`s](https://redirect.github.com/rust-lang/rust/pull/138128)

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

## Compiler

- [x86: make SSE2 required for i686 targets and use it to pass SIMD
types](https://redirect.github.com/rust-lang/rust/pull/135408)

<a id="1.87.0-Platform-Support"></a>

## Platform Support

- [Remove `i586-pc-windows-msvc`
target](https://redirect.github.com/rust-lang/rust/pull/137957)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

[platform-support-doc]:
https://doc.rust-lang.org/rustc/platform-support.html

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

## Libraries

- [Stabilize the anonymous pipe
API](https://redirect.github.com/rust-lang/rust/issues/127154)
- [Add support for unbounded left/right shift
operations](https://redirect.github.com/rust-lang/rust/issues/129375)
- [Print pointer metadata in `Debug` impl of raw
pointers](https://redirect.github.com/rust-lang/rust/pull/135080)
- [`Vec::with_capacity` guarantees it allocates with the amount
requested, even if `Vec::capacity` returns a different
number.](https://redirect.github.com/rust-lang/rust/pull/135933)
- Most `std::arch` intrinsics which don't take pointer arguments can now
be called from safe code if the caller has the appropriate target
features already enabled
([https://github.com/rust-lang/stdarch/pull/1714](https://redirect.github.com/rust-lang/stdarch/pull/1714),
[https://github.com/rust-lang/stdarch/pull/1716](https://redirect.github.com/rust-lang/stdarch/pull/1716),
[https://github.com/rust-lang/stdarch/pull/1717](https://redirect.github.com/rust-lang/stdarch/pull/1717))
- [Undeprecate
`env::home_dir`](https://redirect.github.com/rust-lang/rust/pull/137327)
- [Denote `ControlFlow` as
`#[must_use]`](https://redirect.github.com/rust-lang/rust/pull/137449)
- [Macros such as `assert_eq!` and `vec!` now support `const {...}`
expressions](https://redirect.github.com/rust-lang/rust/pull/138162)

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

## Stabilized APIs

-
[`Vec::extract_if`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.extract_if)
-
[`vec::ExtractIf`](https://doc.rust-lang.org/stable/std/vec/struct.ExtractIf.html)
-
[`LinkedList::extract_if`](https://doc.rust-lang.org/stable/std/collections/struct.LinkedList.html#method.extract_if)
-
[`linked_list::ExtractIf`](https://doc.rust-lang.org/stable/std/collections/linked_list/struct.ExtractIf.html)
-
[`<[T]>::split_off`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off)
-
[`<[T]>::split_off_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_mut)
-
[`<[T]>::split_off_first`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_first)
-
[`<[T]>::split_off_first_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_first_mut)
-
[`<[T]>::split_off_last`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_last)
-
[`<[T]>::split_off_last_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_last_mut)
-
[`String::extend_from_within`](https://doc.rust-lang.org/stable/alloc/string/struct.String.html#method.extend_from_within)
-
[`os_str::Display`](https://doc.rust-lang.org/stable/std/ffi/os_str/struct.Display.html)
-
[`OsString::display`](https://doc.rust-lang.org/stable/std/ffi/struct.OsString.html#method.display)
-
[`OsStr::display`](https://doc.rust-lang.org/stable/std/ffi/struct.OsStr.html#method.display)
-   [`io::pipe`](https://doc.rust-lang.org/stable/std/io/fn.pipe.html)
-
[`io::PipeReader`](https://doc.rust-lang.org/stable/std/io/struct.PipeReader.html)
-
[`io::PipeWriter`](https://doc.rust-lang.org/stable/std/io/struct.PipeWriter.html)
- [`impl From<PipeReader> for
OwnedHandle`](https://doc.rust-lang.org/stable/std/os/windows/io/struct.OwnedHandle.html#impl-From%3CPipeReader%3E-for-OwnedHandle)
- [`impl From<PipeWriter> for
OwnedHandle`](https://doc.rust-lang.org/stable/std/os/windows/io/struct.OwnedHandle.html#impl-From%3CPipeWriter%3E-for-OwnedHandle)
- [`impl From<PipeReader> for
Stdio`](https://doc.rust-lang.org/stable/std/process/struct.Stdio.html)
- [`impl From<PipeWriter> for
Stdio`](https://doc.rust-lang.org/stable/std/process/struct.Stdio.html#impl-From%3CPipeWriter%3E-for-Stdio)
- [`impl From<PipeReader> for
OwnedFd`](https://doc.rust-lang.org/stable/std/os/fd/struct.OwnedFd.html#impl-From%3CPipeReader%3E-for-OwnedFd)
- [`impl From<PipeWriter> for
OwnedFd`](https://doc.rust-lang.org/stable/std/os/fd/struct.OwnedFd.html#impl-From%3CPipeWriter%3E-for-OwnedFd)
-
[`Box<MaybeUninit<T>>::write`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.write)
- [`impl TryFrom<Vec<u8>> for
String`](https://doc.rust-lang.org/stable/std/string/struct.String.html#impl-TryFrom%3CVec%3Cu8%3E%3E-for-String)
- [`<*const
T>::offset_from_unsigned`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.offset_from_unsigned)
- [`<*const
T>::byte_offset_from_unsigned`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.byte_offset_from_unsigned)
- [`<*mut
T>::offset_from_unsigned`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.offset_from_unsigned-1)
- [`<*mut
T>::byte_offset_from_unsigned`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.byte_offset_from_unsigned-1)
-
[`NonNull::offset_from_unsigned`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.offset_from_unsigned)
-
[`NonNull::byte_offset_from_unsigned`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.byte_offset_from_unsigned)
-
[`<uN>::cast_signed`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.cast_signed)
-
[`NonZero::<uN>::cast_signed`](https://doc.rust-lang.org/stable/std/num/struct.NonZero.html#method.cast_signed-5).
-
[`<iN>::cast_unsigned`](https://doc.rust-lang.org/stable/std/primitive.isize.html#method.cast_unsigned).
-
[`NonZero::<iN>::cast_unsigned`](https://doc.rust-lang.org/stable/std/num/struct.NonZero.html#method.cast_unsigned-5).
-
[`<uN>::is_multiple_of`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.is_multiple_of)
-
[`<uN>::unbounded_shl`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.unbounded_shl)
-
[`<uN>::unbounded_shr`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.unbounded_shr)
-
[`<iN>::unbounded_shl`](https://doc.rust-lang.org/stable/std/primitive.isize.html#method.unbounded_shl)
-
[`<iN>::unbounded_shr`](https://doc.rust-lang.org/stable/std/primitive.isize.html#method.unbounded_shr)
-
[`<iN>::midpoint`](https://doc.rust-lang.org/stable/std/primitive.isize.html#method.midpoint)
-
[`<str>::from_utf8`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8)
-
[`<str>::from_utf8_mut`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8\_mut)
-
[`<str>::from_utf8_unchecked`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8\_unchecked)
-
[`<str>::from_utf8_unchecked_mut`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8\_unchecked_mut)

These previously stable APIs are now stable in const contexts:

-
[`core::str::from_utf8_mut`](https://doc.rust-lang.org/stable/std/str/fn.from_utf8\_mut.html)
-
[`<[T]>::copy_from_slice`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.copy_from_slice)
-
[`SocketAddr::set_ip`](https://doc.rust-lang.org/stable/std/net/enum.SocketAddr.html#method.set_ip)
-
[`SocketAddr::set_port`](https://doc.rust-lang.org/stable/std/net/enum.SocketAddr.html#method.set_port),
-
[`SocketAddrV4::set_ip`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV4.html#method.set_ip)
-
[`SocketAddrV4::set_port`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV4.html#method.set_port),
-
[`SocketAddrV6::set_ip`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_ip)
-
[`SocketAddrV6::set_port`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_port)
-
[`SocketAddrV6::set_flowinfo`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_flowinfo)
-
[`SocketAddrV6::set_scope_id`](https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_scope_id)
-
[`char::is_digit`](https://doc.rust-lang.org/stable/std/primitive.char.html#method.is_digit)
-
[`char::is_whitespace`](https://doc.rust-lang.org/stable/std/primitive.char.html#method.is_whitespace)
- [`<[[T;
N]]>::as_flattened`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_flattened)
- [`<[[T;
N]]>::as_flattened_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_flattened_mut)
-
[`String::into_bytes`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.into_bytes)
-
[`String::as_str`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_str)
-
[`String::capacity`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.capacity)
-
[`String::as_bytes`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_bytes)
-
[`String::len`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.len)
-
[`String::is_empty`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.is_empty)
-
[`String::as_mut_str`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_mut_str)
-
[`String::as_mut_vec`](https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_mut_vec)
-
[`Vec::as_ptr`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_ptr)
-
[`Vec::as_slice`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_slice)
-
[`Vec::capacity`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.capacity)
-
[`Vec::len`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.len)
-
[`Vec::is_empty`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.is_empty)
-
[`Vec::as_mut_slice`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_mut_slice)
-
[`Vec::as_mut_ptr`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_mut_ptr)

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

## Cargo

- [Add terminal integration via ANSI OSC 9;4
sequences](https://redirect.github.com/rust-lang/cargo/pull/14615/)
- [chore: bump openssl to
v3](https://redirect.github.com/rust-lang/cargo/pull/15232/)
- [feat(package): add --exclude-lockfile
flag](https://redirect.github.com/rust-lang/cargo/pull/15234/)

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

## Compatibility Notes

- [Rust now raises an error for macro invocations inside the
`#![crate_name]`
attribute](https://redirect.github.com/rust-lang/rust/pull/127581)
- [Unstable fields are now always considered to be
inhabited](https://redirect.github.com/rust-lang/rust/pull/133889)
- [Macro arguments of unary operators followed by open beginning ranges
may now be matched
differently](https://redirect.github.com/rust-lang/rust/pull/134900)
- [Make `Debug` impl of raw pointers print metadata if
present](https://redirect.github.com/rust-lang/rust/pull/135080)
- [Warn against function pointers using unsupported ABI strings in
dependencies](https://redirect.github.com/rust-lang/rust/pull/135767)
- [Associated types on `dyn` types are no longer
deduplicated](https://redirect.github.com/rust-lang/rust/pull/136458)
- [Forbid attributes on `..` inside of struct patterns (`let Struct {
#[attribute] .. })
=`](https://redirect.github.com/rust-lang/rust/pull/136490)
- [Make `ptr_cast_add_auto_to_object` lint into hard
error](https://redirect.github.com/rust-lang/rust/pull/136764)
- Many `std::arch` intrinsics are now safe to call in some contexts,
there may now be new `unused_unsafe` warnings in existing codebases.
- [Limit `width` and `precision` formatting options to 16 bits on all
targets](https://redirect.github.com/rust-lang/rust/pull/136932)
- [Turn order dependent trait objects future incompat warning into a
hard error](https://redirect.github.com/rust-lang/rust/pull/136968)
- [Denote `ControlFlow` as
`#[must_use]`](https://redirect.github.com/rust-lang/rust/pull/137449)
- [Windows: The standard library no longer links `advapi32`, except on
win7.](https://redirect.github.com/rust-lang/rust/pull/138233) Code such
as C libraries that were relying on this assumption may need to
explicitly link advapi32.
- [Proc macros can no longer observe expanded `cfg(true)`
attributes.](https://redirect.github.com/rust-lang/rust/pull/138844)
- [Start changing the internal representation of pasted
tokens](https://redirect.github.com/rust-lang/rust/pull/124141). Certain
invalid declarative macros that were previously accepted in obscure
circumstances are now correctly rejected by the compiler. Use of a `tt`
fragment specifier can often fix these macros.
- [Don't allow flattened format_args in
const.](https://redirect.github.com/rust-lang/rust/pull/139624)

<a id="1.87.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
20](https://redirect.github.com/rust-lang/rust/pull/135763)

</details>

---

### Configuration

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

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

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

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

---

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

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/rust-lang/cargo).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4xMS4xOCIsInVwZGF0ZWRJblZlciI6IjQwLjExLjE4IiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->
2025-05-20 21:41:48 +00:00
Ed Page
31433a3094 chore: Bump package versions 2025-05-20 16:08:34 -05:00
Ed Page
62ba9df97a
Fix comment for cargo/core/compiler/fingerprint/mod.rs (#15565)
<!--
Thanks for submitting a pull request 🎉! Here are some tips for you:

* If this is your first contribution, read "Cargo Contribution Guide"
first:
  https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to
review.
* If your idea is large and needs feedback from the community, read how:
  https://doc.crates.io/contrib/process/#working-on-large-features
* Cargo takes care of compatibility. Read our design principles:
  https://doc.crates.io/contrib/design.html
* When changing help text of cargo commands, follow the steps to
generate docs:

https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
* If your PR is not finished, set it as "draft" PR or add "WIP" in its
title.
* It's ok to use the CI resources to test your PR, but please don't
abuse them.

### What does this PR try to resolve?

Fix comment for cargo/core/compiler/fingerprint/mod.rs

### How should we test and review this PR?

Demonstrate how you test this change and guide reviewers through your
PR.
With a smooth review process, a pull request usually gets reviewed
quicker.

If you don't know how to write and run your tests, please read the
guide:
https://doc.crates.io/contrib/tests

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->
2025-05-20 16:44:27 +00:00
Weihang Lo
c36e6f258e
fix: remove unnecessary workaround in standard_lib test (#15522)
### What does this PR try to resolve?

- As issue https://github.com/rust-lang/rust/issues/125246 has already
been fixed, there must be no need for commenting out `--sysroot` anymore
in the tests.

- The bug mentioned in `shared_std_dependency_rebuild()` looks to be
already solved and does not reproduce. So I guess it's safe to
un-comment those lines.
2025-05-20 11:45:38 +00:00
motorailgun
ff1849fc54 fix: remove unnecessary workaround in standard_lib test 2025-05-20 08:23:34 +00:00
carrychair
94a7303fd7 Fix comment for cargo/core/compiler/fingerprint/mod.rs
Signed-off-by: carrychair <linghuchong404@gmail.com>
2025-05-20 15:45:02 +08:00
Weihang Lo
a466cc5e85
Allow configuring arbitrary codegen backends (#15562)
Rather than just builtin codegen backends. This is perma-unstable on the
rustc side, but is useful to enable a codegen backend built separately
from rustc to be used without overwriting RUSTFLAGS as well as to allow
configuring the codegen backend on a per-package basis.
2025-05-19 15:06:41 +00:00
bjorn3
649aca79c0 Allow configuring arbitrary codegen backends
Rather than just builtin codegen backends. This is perma-unstable on the
rustc side, but is useful to enable a codegen backend built separately
from rustc to be used without overwriting RUSTFLAGS as well as to allow
configuring the codegen backend on a per-package basis.
2025-05-19 13:29:00 +02:00
Weihang Lo
5052f88917
Update dependencies (#15557)
Routine update of dependencies. It's been a long while since the last
full update.

Tempfile is updated since it is generating a deprecation due to a method
rename.

I presume the help output change is due to an update in clap.

Handlebars is not updated due to
https://github.com/sunng87/handlebars-rust/issues/711

Updating ahash v0.8.11 -> v0.8.12
Updating anyhow v1.0.96 -> v1.0.98
Updating base64ct v1.6.0 -> v1.7.3
Updating bitflags v2.8.0 -> v2.9.1
Updating blake3 v1.6.1 -> v1.8.2
Updating bstr v1.11.3 -> v1.12.0
Updating bytes v1.10.0 -> v1.10.1
Updating cargo_metadata v0.19.1 -> v0.19.2
Updating cc v1.2.16 -> v1.2.23
Updating clap v4.5.31 -> v4.5.38
Updating clap_builder v4.5.31 -> v4.5.38
Updating clap_complete v4.5.46 -> v4.5.50
Updating ct-codecs v1.1.3 -> v1.1.5
Updating darling v0.20.10 -> v0.20.11
Updating darling_core v0.20.10 -> v0.20.11
Updating darling_macro v0.20.10 -> v0.20.11
Updating der v0.7.9 -> v0.7.10
Updating deranged v0.3.11 -> v0.4.0
Updating dyn-clone v1.0.18 -> v1.0.19
Updating either v1.13.0 -> v1.15.0
Updating equivalent v1.0.1 -> v1.0.2
Updating erased-serde v0.4.5 -> v0.4.6
Updating errno v0.3.10 -> v0.3.12
Updating escargot v0.5.13 -> v0.5.14
  Adding faster-hex v0.10.0
Updating ff v0.13.0 -> v0.13.1
Updating foldhash v0.1.4 -> v0.1.5
Removing getrandom v0.2.15
Removing getrandom v0.3.1
  Adding getrandom v0.2.16
  Adding getrandom v0.3.3
Updating git2 v0.20.0 -> v0.20.2
Removing gix-features v0.41.0
  Adding gix-features v0.41.1
  Adding gix-features v0.42.1
  Adding gix-fs v0.15.0
  Adding gix-hash v0.18.0
Updating gix-hashtable v0.8.0 -> v0.8.1
Updating gix-lock v17.0.0 -> v17.1.0
Updating gix-path v0.10.15 -> v0.10.18
Updating gix-tempfile v17.0.0 -> v17.1.0
  Adding gix-utils v0.3.0
  Adding gix-validate v0.10.0
Updating globset v0.4.15 -> v0.4.16
Updating half v2.4.1 -> v2.6.0
  Adding hash32 v0.3.1
Updating hashbrown v0.15.2 -> v0.15.3
  Adding heapless v0.8.0
Updating hermit-abi v0.4.0 -> v0.5.1
Updating icu_collections v1.5.0 -> v2.0.0
  Adding icu_locale_core v2.0.0
Removing icu_locid v1.5.0
Removing icu_locid_transform v1.5.0
Removing icu_locid_transform_data v1.5.0
Updating icu_normalizer v1.5.0 -> v2.0.0
Updating icu_normalizer_data v1.5.0 -> v2.0.0
Updating icu_properties v1.5.1 -> v2.0.0
Updating icu_properties_data v1.5.0 -> v2.0.0
Updating icu_provider v1.5.0 -> v2.0.0
Removing icu_provider_macros v1.5.0
Updating idna_adapter v1.2.0 -> v1.2.1
Updating indexmap v2.7.1 -> v2.9.0
Updating is-terminal v0.4.15 -> v0.4.16
Updating itoa v1.0.14 -> v1.0.15
Updating jiff v0.2.3 -> v0.2.13
Updating jiff-static v0.2.3 -> v0.2.13
Updating jiff-tzdb v0.1.2 -> v0.1.4
Updating jiff-tzdb-platform v0.1.2 -> v0.1.3
Updating jobserver v0.1.32 -> v0.1.33
Updating libc v0.2.170 -> v0.2.172
Updating libgit2-sys v0.18.0+1.9.0 -> v0.18.1+1.9.0 Updating libloading
v0.8.6 -> v0.8.7
Updating libz-sys v1.1.21 -> v1.1.22
  Adding linux-raw-sys v0.9.4
Updating litemap v0.7.4 -> v0.8.0
Updating log v0.4.25 -> v0.4.27
Updating miniz_oxide v0.8.5 -> v0.8.8
Updating once_cell v1.20.3 -> v1.21.3
Updating oorandom v11.1.4 -> v11.1.5
Updating openssl-src v300.4.2+3.4.1 -> v300.5.0+3.5.0 Updating
openssl-sys v0.9.107 -> v0.9.108
Updating orion v0.17.8 -> v0.17.10
Updating os_info v3.10.0 -> v3.11.0
Updating pasetors v0.7.2 -> v0.7.4
Updating pest v2.7.15 -> v2.8.0
Updating pest_derive v2.7.15 -> v2.8.0
Updating pest_generator v2.7.15 -> v2.8.0
Updating pest_meta v2.7.15 -> v2.8.0
Updating pkg-config v0.3.31 -> v0.3.32
Updating portable-atomic v1.10.0 -> v1.11.0
  Adding potential_utf v0.1.2
Updating ppv-lite86 v0.2.20 -> v0.2.21
Updating proc-macro2 v1.0.93 -> v1.0.95
Updating prodash v29.0.1 -> v29.0.2
Updating quote v1.0.38 -> v1.0.40
  Adding r-efi v5.2.0
Updating rand v0.9.0 -> v0.9.1
Updating rand_core v0.9.0 -> v0.9.3
Updating redox_syscall v0.5.8 -> v0.5.12
Updating ref-cast v1.0.23 -> v1.0.24
Updating ref-cast-impl v1.0.23 -> v1.0.24
  Adding rustix v1.0.7
Updating rustversion v1.0.19 -> v1.0.20
Updating ryu v1.0.19 -> v1.0.20
Updating semver v1.0.25 -> v1.0.26
Updating serde v1.0.218 -> v1.0.219
Updating serde-untagged v0.1.6 -> v0.1.7
Updating serde_derive v1.0.218 -> v1.0.219
Updating serde_ignored v0.1.10 -> v0.1.12
Updating serde_json v1.0.139 -> v1.0.140
Updating sha2 v0.10.8 -> v0.10.9
Updating smallvec v1.13.2 -> v1.15.0
Updating socket2 v0.5.8 -> v0.5.9
Updating syn v2.0.98 -> v2.0.101
Updating synstructure v0.13.1 -> v0.13.2
Updating tempfile v3.17.1 -> v3.20.0
Updating terminal_size v0.4.1 -> v0.4.2
Updating thiserror v2.0.11 -> v2.0.12
Updating thiserror-impl v2.0.11 -> v2.0.12
Updating time v0.3.37 -> v0.3.41
Updating time-core v0.1.2 -> v0.1.4
Updating time-macros v0.2.19 -> v0.2.22
Updating tinystr v0.7.6 -> v0.8.1
Updating tinyvec v1.8.1 -> v1.9.0
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
Updating typeid v1.0.2 -> v1.0.3
Updating typenum v1.17.0 -> v1.18.0
Updating unicode-ident v1.0.17 -> v1.0.18
Removing utf16_iter v1.0.5
Updating wasi v0.13.3+wasi-0.2.2 -> v0.14.2+wasi-0.2.4
  Adding windows-targets v0.53.0
  Adding windows_aarch64_gnullvm v0.53.0
  Adding windows_aarch64_msvc v0.53.0
  Adding windows_i686_gnu v0.53.0
  Adding windows_i686_gnullvm v0.53.0
  Adding windows_i686_msvc v0.53.0
  Adding windows_x86_64_gnu v0.53.0
  Adding windows_x86_64_gnullvm v0.53.0
  Adding windows_x86_64_msvc v0.53.0
Updating winnow v0.7.1 -> v0.7.10
Updating wit-bindgen-rt v0.33.0 -> v0.39.0
Removing write16 v1.0.0
Updating writeable v0.5.5 -> v0.6.1
Updating yoke v0.7.5 -> v0.8.0
Updating yoke-derive v0.7.5 -> v0.8.0
Removing zerocopy v0.7.35
Removing zerocopy v0.8.17
  Adding zerocopy v0.8.25
Removing zerocopy-derive v0.7.35
Removing zerocopy-derive v0.8.17
  Adding zerocopy-derive v0.8.25
Updating zerofrom v0.1.5 -> v0.1.6
Updating zerofrom-derive v0.1.5 -> v0.1.6
  Adding zerotrie v0.2.2
Updating zerovec v0.10.4 -> v0.11.2
Updating zerovec-derive v0.10.3 -> v0.11.1

<!--
Thanks for submitting a pull request 🎉! Here are some tips for you:

* If this is your first contribution, read "Cargo Contribution Guide"
first:
  https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to
review.
* If your idea is large and needs feedback from the community, read how:
  https://doc.crates.io/contrib/process/#working-on-large-features
* Cargo takes care of compatibility. Read our design principles:
  https://doc.crates.io/contrib/design.html
* When changing help text of cargo commands, follow the steps to
generate docs:

https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
* If your PR is not finished, set it as "draft" PR or add "WIP" in its
title.
* It's ok to use the CI resources to test your PR, but please don't
abuse them.

### What does this PR try to resolve?

Explain the motivation behind this change.
A clear overview along with an in-depth explanation are helpful.

You can use `Fixes #<issue number>` to associate this PR to an existing
issue.

### How should we test and review this PR?

Demonstrate how you test this change and guide reviewers through your
PR.
With a smooth review process, a pull request usually gets reviewed
quicker.

If you don't know how to write and run your tests, please read the
guide:
https://doc.crates.io/contrib/tests

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->
2025-05-18 03:02:27 +00:00
Eric Huss
cbdb9f0620 Update dependencies
Routine update of dependencies.

Tempfile is updated since it is generating a deprecation due to a method
rename.

I presume the help output change is due to an update in clap.

Handlebars is not updated due to
https://github.com/sunng87/handlebars-rust/issues/711

Updating ahash v0.8.11 -> v0.8.12
Updating anyhow v1.0.96 -> v1.0.98
Updating base64ct v1.6.0 -> v1.7.3
Updating bitflags v2.8.0 -> v2.9.1
Updating blake3 v1.6.1 -> v1.8.2
Updating bstr v1.11.3 -> v1.12.0
Updating bytes v1.10.0 -> v1.10.1
Updating cargo_metadata v0.19.1 -> v0.19.2
Updating cc v1.2.16 -> v1.2.23
Updating clap v4.5.31 -> v4.5.38
Updating clap_builder v4.5.31 -> v4.5.38
Updating clap_complete v4.5.46 -> v4.5.50
Updating ct-codecs v1.1.3 -> v1.1.5
Updating darling v0.20.10 -> v0.20.11
Updating darling_core v0.20.10 -> v0.20.11
Updating darling_macro v0.20.10 -> v0.20.11
Updating der v0.7.9 -> v0.7.10
Updating deranged v0.3.11 -> v0.4.0
Updating dyn-clone v1.0.18 -> v1.0.19
Updating either v1.13.0 -> v1.15.0
Updating equivalent v1.0.1 -> v1.0.2
Updating erased-serde v0.4.5 -> v0.4.6
Updating errno v0.3.10 -> v0.3.12
Updating escargot v0.5.13 -> v0.5.14
  Adding faster-hex v0.10.0
Updating ff v0.13.0 -> v0.13.1
Updating foldhash v0.1.4 -> v0.1.5
Removing getrandom v0.2.15
Removing getrandom v0.3.1
  Adding getrandom v0.2.16
  Adding getrandom v0.3.3
Updating git2 v0.20.0 -> v0.20.2
Removing gix-features v0.41.0
  Adding gix-features v0.41.1
  Adding gix-features v0.42.1
  Adding gix-fs v0.15.0
  Adding gix-hash v0.18.0
Updating gix-hashtable v0.8.0 -> v0.8.1
Updating gix-lock v17.0.0 -> v17.1.0
Updating gix-path v0.10.15 -> v0.10.18
Updating gix-tempfile v17.0.0 -> v17.1.0
  Adding gix-utils v0.3.0
  Adding gix-validate v0.10.0
Updating globset v0.4.15 -> v0.4.16
Updating half v2.4.1 -> v2.6.0
  Adding hash32 v0.3.1
Updating hashbrown v0.15.2 -> v0.15.3
  Adding heapless v0.8.0
Updating hermit-abi v0.4.0 -> v0.5.1
Updating icu_collections v1.5.0 -> v2.0.0
  Adding icu_locale_core v2.0.0
Removing icu_locid v1.5.0
Removing icu_locid_transform v1.5.0
Removing icu_locid_transform_data v1.5.0
Updating icu_normalizer v1.5.0 -> v2.0.0
Updating icu_normalizer_data v1.5.0 -> v2.0.0
Updating icu_properties v1.5.1 -> v2.0.0
Updating icu_properties_data v1.5.0 -> v2.0.0
Updating icu_provider v1.5.0 -> v2.0.0
Removing icu_provider_macros v1.5.0
Updating idna_adapter v1.2.0 -> v1.2.1
Updating indexmap v2.7.1 -> v2.9.0
Updating is-terminal v0.4.15 -> v0.4.16
Updating itoa v1.0.14 -> v1.0.15
Updating jiff v0.2.3 -> v0.2.13
Updating jiff-static v0.2.3 -> v0.2.13
Updating jiff-tzdb v0.1.2 -> v0.1.4
Updating jiff-tzdb-platform v0.1.2 -> v0.1.3
Updating jobserver v0.1.32 -> v0.1.33
Updating libc v0.2.170 -> v0.2.172
Updating libgit2-sys v0.18.0+1.9.0 -> v0.18.1+1.9.0
Updating libloading v0.8.6 -> v0.8.7
Updating libz-sys v1.1.21 -> v1.1.22
  Adding linux-raw-sys v0.9.4
Updating litemap v0.7.4 -> v0.8.0
Updating log v0.4.25 -> v0.4.27
Updating miniz_oxide v0.8.5 -> v0.8.8
Updating once_cell v1.20.3 -> v1.21.3
Updating oorandom v11.1.4 -> v11.1.5
Updating openssl-src v300.4.2+3.4.1 -> v300.5.0+3.5.0
Updating openssl-sys v0.9.107 -> v0.9.108
Updating orion v0.17.8 -> v0.17.10
Updating os_info v3.10.0 -> v3.11.0
Updating pasetors v0.7.2 -> v0.7.4
Updating pest v2.7.15 -> v2.8.0
Updating pest_derive v2.7.15 -> v2.8.0
Updating pest_generator v2.7.15 -> v2.8.0
Updating pest_meta v2.7.15 -> v2.8.0
Updating pkg-config v0.3.31 -> v0.3.32
Updating portable-atomic v1.10.0 -> v1.11.0
  Adding potential_utf v0.1.2
Updating ppv-lite86 v0.2.20 -> v0.2.21
Updating proc-macro2 v1.0.93 -> v1.0.95
Updating prodash v29.0.1 -> v29.0.2
Updating quote v1.0.38 -> v1.0.40
  Adding r-efi v5.2.0
Updating rand v0.9.0 -> v0.9.1
Updating rand_core v0.9.0 -> v0.9.3
Updating redox_syscall v0.5.8 -> v0.5.12
Updating ref-cast v1.0.23 -> v1.0.24
Updating ref-cast-impl v1.0.23 -> v1.0.24
  Adding rustix v1.0.7
Updating rustversion v1.0.19 -> v1.0.20
Updating ryu v1.0.19 -> v1.0.20
Updating semver v1.0.25 -> v1.0.26
Updating serde v1.0.218 -> v1.0.219
Updating serde-untagged v0.1.6 -> v0.1.7
Updating serde_derive v1.0.218 -> v1.0.219
Updating serde_ignored v0.1.10 -> v0.1.12
Updating serde_json v1.0.139 -> v1.0.140
Updating sha2 v0.10.8 -> v0.10.9
Updating smallvec v1.13.2 -> v1.15.0
Updating socket2 v0.5.8 -> v0.5.9
Updating syn v2.0.98 -> v2.0.101
Updating synstructure v0.13.1 -> v0.13.2
Updating tempfile v3.17.1 -> v3.20.0
Updating terminal_size v0.4.1 -> v0.4.2
Updating thiserror v2.0.11 -> v2.0.12
Updating thiserror-impl v2.0.11 -> v2.0.12
Updating time v0.3.37 -> v0.3.41
Updating time-core v0.1.2 -> v0.1.4
Updating time-macros v0.2.19 -> v0.2.22
Updating tinystr v0.7.6 -> v0.8.1
Updating tinyvec v1.8.1 -> v1.9.0
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
Updating typeid v1.0.2 -> v1.0.3
Updating typenum v1.17.0 -> v1.18.0
Updating unicode-ident v1.0.17 -> v1.0.18
Removing utf16_iter v1.0.5
Updating wasi v0.13.3+wasi-0.2.2 -> v0.14.2+wasi-0.2.4
  Adding windows-targets v0.53.0
  Adding windows_aarch64_gnullvm v0.53.0
  Adding windows_aarch64_msvc v0.53.0
  Adding windows_i686_gnu v0.53.0
  Adding windows_i686_gnullvm v0.53.0
  Adding windows_i686_msvc v0.53.0
  Adding windows_x86_64_gnu v0.53.0
  Adding windows_x86_64_gnullvm v0.53.0
  Adding windows_x86_64_msvc v0.53.0
Updating winnow v0.7.1 -> v0.7.10
Updating wit-bindgen-rt v0.33.0 -> v0.39.0
Removing write16 v1.0.0
Updating writeable v0.5.5 -> v0.6.1
Updating yoke v0.7.5 -> v0.8.0
Updating yoke-derive v0.7.5 -> v0.8.0
Removing zerocopy v0.7.35
Removing zerocopy v0.8.17
  Adding zerocopy v0.8.25
Removing zerocopy-derive v0.7.35
Removing zerocopy-derive v0.8.17
  Adding zerocopy-derive v0.8.25
Updating zerofrom v0.1.5 -> v0.1.6
Updating zerofrom-derive v0.1.5 -> v0.1.6
  Adding zerotrie v0.2.2
Updating zerovec v0.10.4 -> v0.11.2
Updating zerovec-derive v0.10.3 -> v0.11.1
2025-05-17 19:32:32 -07:00
renovate[bot]
8b5fd61ec8
chore(deps): update msrv (1 version) to v1.87 2025-05-15 23:35:57 +00:00
Eric Huss
47c911e9e6
Stabilize doctest-xcompile (#15462)
This stabilizes the doctest-xcompile feature by unconditionally enabling
it.

Closes https://github.com/rust-lang/cargo/issues/7040
Closes https://github.com/rust-lang/cargo/issues/12118

## What is being stabilized?

This changes it so that cargo will run doctests when using the
`--target` flag for a target that is not the host. Previously, cargo
would ignore doctests (and show a note if passing `--verbose`).

A wrapper for running the doctest can be specified with the
[`target.*.runner`](https://doc.rust-lang.org/cargo/reference/config.html#targettriplerunner)
configuration option (which is powered by the `--test-runtool` rustdoc
flag). This would typically be something like qemu to run under
emulation. It is my understanding that this should work just like
running other kinds of tests.

Additionally, the
[`target.*.linker`](https://doc.rust-lang.org/cargo/reference/config.html#targettriplelinker)
config option is honored for using a custom linker.

Already stabilized in rustdoc is the ability to [ignore tests
per-target](https://doc.rust-lang.org/nightly/rustdoc/write-documentation/documentation-tests.html#ignoring-targets).

## Motivation

The lack of doctest cross-compile support has always been simply due to
the lack of functionality in rustdoc to support this. Rustdoc gained the
ability to cross-compile doctests some time ago, but there were
additional flags like the test runner that were not stabilized until
just recently.

This is intended to ensure that projects have full test coverage even
when doing cross-compilation. It can be
[surprising](https://github.com/rust-lang/cargo/issues/12118) to some
that this was not happening, particularly since cargo is silent about
it.

## Risks

The cargo team had several conversations about how to roll out this
feature. Ultimately we decided to enable it unconditionally with the
understanding that most projects will probably want to have their
doctests covered, and that any breakage will be a local concern that can
be resolved by either fixing the test or ignoring the target.

Tests in rust-lang/rust run into this issue, [particularly on
android](https://github.com/rust-lang/rust/pull/119147#issuecomment-1863712897),
and those will need to be fixed before this reaches beta. This is
something I am looking into.

Some cross-compiling scenarios may need codegen flags that are not
supported. It's not clear how common this will be, or if ignoring will
be a solution, or how difficult it would be to update rustdoc and cargo
to support these. Additionally, the split between RUSTFLAGS and
RUSTDOCFLAGS can be cumbersome.

## Implementation history

- https://github.com/rust-lang/rust/pull/60387 -- Support added to
rustdoc to support the `--target` flag and runtool and
per-target-ignores.
- https://github.com/rust-lang/cargo/pull/6892 -- Initial support in
cargo.
- https://github.com/rust-lang/cargo/pull/7391 -- Added unstable
documentation.
- https://github.com/rust-lang/cargo/pull/8094 -- Fix target for doc
test cross compilation
- https://github.com/rust-lang/cargo/pull/8358 -- Fixed regression with
`--target=HOST` not working on stable.
- https://github.com/rust-lang/cargo/pull/10132 -- Added note about
doctests not running (under `--verbose`).
- https://github.com/rust-lang/rust/pull/112751 -- Fixed
`--test-run-directory` interaction with `--test-runtool`.
- https://github.com/rust-lang/rust/pull/137096 -- Stabilization (and
rename) of the rustdoc `--test-runtool` and `--test-runtool-arg` CLI
args, and drops `--enable-per-target-ignores` unconditionally enabling
it.

## Test coverage

Cargo tests:
-
[artifact_dep::cross_doctests_works_with_artifacts](56c08f84e2/tests/testsuite/artifact_dep.rs (L1248-L1326))
-- Checks that doctest has access to the artifact dependencies.
-
[build_script::duplicate_script_with_extra_env](56c08f84e2/tests/testsuite/build_script.rs (L5514-L5614))
-- Checks that build-script env and cfg values are correctly handled on
host versus target when cross running doctests.
-
[cross_compile::cross_tests](56c08f84e2/tests/testsuite/cross_compile.rs (L416-L502))
-- Basic test that cross-compiled tests work.
-
[cross_compile::doctest_xcompile_linker](56c08f84e2/tests/testsuite/cross_compile.rs (L1139-L1182))
-- Checks that the linker config argument works.
-
[custom_target::custom_target_minimal](56c08f84e2/tests/testsuite/custom_target.rs (L39-L71))
-- Checks that `.json` targets work with rustdoc cross tests.
-
[test::cargo_test_doctest_xcompile_ignores](56c08f84e2/tests/testsuite/test.rs (L4743-L4777))
-- Checks the `ignore-*` syntax works.
-
[test::cargo_test_doctest_xcompile_runner](2603268cda/tests/testsuite/test.rs (L4783-L4863))
-- Checks runner with cross doctests.
-
[test::cargo_test_doctest_xcompile_no_runner](2603268cda/tests/testsuite/test.rs (L4869-L4907))
-- Checks cross doctests without a runner.

Rustdoc tests:
-
[run-make/doctest-runtool](25cdf1f674/tests/run-make/doctests-runtool)
-- Tests behavior of `--test-run-directory` with relative paths of the
runner.
-
[rustdoc/doctest/doctest-runtool](25cdf1f674/tests/rustdoc/doctest/doctest-runtool.rs)
-- Tests for `--test-runtool` and `--test-runtool-arg`.

## Future concerns

There have been some discussions
(https://github.com/rust-lang/testing-devex-team/issues/5) about
changing how doctests are driven. My understanding is that stabilizing
this should not affect those plans, since if cargo becomes the driver,
it will simply need to build things with `--target` and use the
appropriate runner.

## Change notes

This PR changed tests a little:
- artifact_dep::no_cross_doctests_works_with_artifacts was changed now
that doctests actually work.
- cross_compile::cross_tests was changed to properly check doctests.
- cross_compile::no_cross_doctests dropped since it is no longer
relevant.
- standard_lib::doctest didn't need `-Zdoctest-xcompile` since
`-Zbuild-std` no longer uses a target.
- test::cargo_test_doctest_xcompile was removed since it is a duplicate
of cross_compile::cross_tests

I think this should probably wait until the next release cutoff, moving
this to 1.89 (will update the PR accordingly if that happens).
2025-05-14 17:53:17 +00:00
Eric Huss
4194703c99 Update stabilization to 1.89 2025-05-14 08:54:06 -07:00
Eric Huss
bead46769c Stabilize doctest-xcompile
This stabilizes the doctest-xcompile feature by unconditionally enabling
it.
2025-05-14 08:52:27 -07:00
Ed Page
a14791c355
feat: skip publish=false pkg when publishing entire workspace (#15525)
### What does this PR try to resolve?

Fixes #15006

This changes how cargo-publish works with the unstable
`-Zpackage-workspace` feature.

Before this, when publishing the entire workspace,
like `cargo publish --workspace`,
if there is a package with `package.pulibsh=false,
it'll fail the entire publish process.

After this, when `--workspace` is passed,
or when publishing the virtual workspace,
the intent is more like “publish all publishable in this workspace”,
so skip `publish=false` packages and proceed to publish others.

The new overall behavior looks like this:

* `cargo publish` (inside a `package.publish = false` package): error
* `cargo publish -p publishable -p unpublishable`: error
* `cargo publish --workspace`: skips `package.publish = false

See
https://github.com/rust-lang/cargo/issues/15006#issuecomment-2847660911

### How should we test and review this PR?

* `workspace_flag_with_unpublishable_packages` was added to ensure
`--workspace` work with non-virtual workspace.
* `unpublishable_package_as_versioned_dev_dep` was added to ensure
versioned dev-dependencies won't be skipped and still fail
cargo-publish, as they are required to be published.

There is a new scenario that nothing is going to publish.
I went with a warning instead of hard error because missing publish for
the entire worspace should be a fairly visible. However, this is open
for future to configure via Cargo lint system.
2025-05-14 05:54:19 +00:00
Weihang Lo
090dcfe9af
fix(publish): better message when nothing to publish
This doesn't need to be an hard error because missing
publish for the entire worspace should be a fairly visible.
However, this is open for future to configure via Cargo lint system.
2025-05-14 01:22:30 -04:00
Weihang Lo
4f7494c4ec
feat(publish): workspace publish skips publish=false
This changes how cargo-publish works with the unstable
`-Zpackage-workspace` feature.

Before this, when publishing the entire workspace,
like `cargo publish --workspace`,
if there is a package with `package.pulibsh=false,
it'll fail the entire publish process.

After this, when `--workspace` is passed,
or when publishing the virtual workspace,
the intent is more like “publish all publishable in this workspace”,
so skip `publish=false` packages and proceed to publish others.

The new overall behavior looks like this:

- `cargo publish` (inside a `package.publish = false` package): error
- `cargo publish -p publishable -p unpublishable`: error
- `cargo publish --workspace`: skips `package.publish = false

See https://github.com/rust-lang/cargo/issues/15006#issuecomment-2847660911
2025-05-14 01:22:29 -04:00
Weihang Lo
6f8136488e
refactor(publish): extract "no publishable found" error 2025-05-14 01:21:10 -04:00
Weihang Lo
2421496c92
test(publish): prepare tests for skipping unpublishable
For `-Zpackage-workspace`.
2025-05-14 01:08:22 -04:00
Ed Page
966229a4c9
chore: bump to 0.90.0; update changelog (#15520)
[rendered](https://github.com/weihanglo/cargo/blob/version-bump/src/doc/src/CHANGELOG.md)

or preview through `mdbook serve src/doc`

---

Note that the long note of `-Zgc` stabilization is from Josh's comment
here:
<https://github.com/rust-lang/cargo/pull/14287#issuecomment-2802552543>
2025-05-12 23:50:10 +00:00
Weihang Lo
da104f3981
docs: update changelog for 1.89.0 2025-05-12 17:27:10 -04:00
Weihang Lo
eb89766947
docs: update changelog for 1.88.0 2025-05-12 17:26:45 -04:00
Weihang Lo
3f03281918
docs: update changelog for 1.87.0 2025-05-12 17:24:13 -04:00
Weihang Lo
6459528bca
chore: bump to 0.90.0 2025-05-12 17:24:13 -04:00
Ed Page
3c5bb555ca
chore(triagebot): add [no-mentions] and [note] (#15517)
`[no-mentions]` is for preventing something like
<https://github.com/rust-lang/cargo/pull/15378#issuecomment-2855248173>.
Well, maybe not working for PR description, I don't know.

`[note]` is for somebody else wanting to help summarize but having no
permission to edit top-level comments.

See docs for more:

* https://forge.rust-lang.org/triagebot/note.html
* https://forge.rust-lang.org/triagebot/no-mentions.html
2025-05-10 18:43:16 +00:00
Weihang Lo
541a51c146
chore(triagebot): add [no-mentions] and [note] 2025-05-10 14:04:39 -04:00
Weihang Lo
13625cec0b
add glob pattern support for known_hosts (#15508)
### What does this PR try to resolve?

This PR implements glob pattern match for known_hosts file. Hosts
written with `*` and `?` now matches correctly.

### Tests

Tests are added accordingly.

### Miscs

This is my first time submitting PR, sorry if there's anything that's
off although I've read the contributor guide.
2025-05-10 16:29:00 +00:00
motorailgun
e68d951a12 add glob pattern support for known_hosts 2025-05-10 15:42:36 +00:00