18235 Commits

Author SHA1 Message Date
Ed Page
0ece9b9d93 test(publish): Consolidate dev-dep stripping tests 2024-07-30 13:38:10 -05:00
bors
257b72b8ad Auto merge of #14324 - epage:toml, r=ehuss
chore: Update toml

This brings performance improvements and an error message fix
2024-07-30 15:08:27 +00:00
Ed Page
9f61ab97a3 chore: Update toml
This brings performance improvements and an error message fix
2024-07-30 09:01:27 -05:00
bors
62f2d3b23e Auto merge of #14318 - Eh2406:wrap_is_not_cheap, r=epage
dont call wrap in a no-op source_id::with*

### What does this PR try to resolve?

When running resolution in parallel (which my pubgrub tests do but cargo does not) there can be a lot of contention on the lock for constructing new `source_id`. When investigating much of this is due to `without_precise` in `encodable_package_id` in `check_duplicate_pkgs_in_lockfile`. There are many ways to solve this, the simplest seems to be to return `self` if the requested modification made no difference.

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

All tests still pass and it's an internal re-factor.

In addition running all crates on crates.io through cargoes resolver in parallel on 190 cores went from >20k sec cpu time to ~10k.

### Additional information
2024-07-29 19:42:39 +00:00
Jacob Finkelman
22f4352c29 with_precise as a helper 2024-07-29 19:33:21 +00:00
bors
46e7e8352d Auto merge of #14319 - epage:doc-json, r=weihanglo
Partial revert of 3085b548ecbd7d29d40c6180609ea3c224bad857

This is to quickly resolve a test failure from #14318
2024-07-29 18:09:42 +00:00
Ed Page
3ae40458a5 Partial revert of 3085b548ecbd7d29d40c6180609ea3c224bad857
This is to quickly resolve a test failure from #14318
2024-07-29 12:59:00 -05:00
Jacob Finkelman
d2d210257f dont call wrap in a no-op source_id::with* 2024-07-29 17:15:41 +00:00
bors
a7c4206e17 Auto merge of #14303 - rust-lang:renovate/msrv, r=epage
chore(deps): update msrv

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change | Pending |
|---|---|---|---|
| [MSRV:1](https://togithub.com/rust-lang/rust) | minor | `1.79` -> `1.80` |  |
| [MSRV:3](https://togithub.com/rust-lang/rust) | minor | `1.77` -> `1.78` | `1.80` (+1) |

---

### Release Notes

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

### [`v1.80`](https://togithub.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1800-2024-07-25)

[Compare Source](https://togithub.com/rust-lang/rust/compare/1.79.0...1.80.0)

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

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

## Language

-   [Document maximum allocation size](https://togithub.com/rust-lang/rust/pull/116675/)
-   [Allow zero-byte offsets and ZST read/writes on arbitrary pointers](https://togithub.com/rust-lang/rust/pull/117329/)
-   [Support C23's variadics without a named parameter](https://togithub.com/rust-lang/rust/pull/124048/)
-   [Stabilize `exclusive_range_pattern` feature](https://togithub.com/rust-lang/rust/pull/124459/)
-   [Guarantee layout and ABI of `Result` in some scenarios](https://togithub.com/rust-lang/rust/pull/124870)

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

## Compiler

-   [Update cc crate to v1.0.97 allowing additional spectre mitigations on MSVC targets](https://togithub.com/rust-lang/rust/pull/124892/)
-   [Allow field reordering on types marked `repr(packed(1))`](https://togithub.com/rust-lang/rust/pull/125360/)
-   [Add a lint against never type fallback affecting unsafe code](https://togithub.com/rust-lang/rust/pull/123939/)
-   [Disallow cast with trailing braced macro in let-else](https://togithub.com/rust-lang/rust/pull/125049/)
-   [Expand `for_loops_over_fallibles` lint to lint on fallibles behind references.](https://togithub.com/rust-lang/rust/pull/125156/)
-   [self-contained linker: retry linking without `-fuse-ld=lld` on CCs that don't support it](https://togithub.com/rust-lang/rust/pull/125417/)
-   [Do not parse CVarArgs (`...`) as a type in trait bounds](https://togithub.com/rust-lang/rust/pull/125863/)
-   Improvements to LLDB formatting [#&#8203;124458](https://togithub.com/rust-lang/rust/pull/124458) [#&#8203;124500](https://togithub.com/rust-lang/rust/pull/124500)
-   [For the wasm32-wasip2 target default to PIC and do not use `-fuse-ld=lld`](https://togithub.com/rust-lang/rust/pull/124858/)
-   [Add x86\_64-unknown-linux-none as a tier 3 target](https://togithub.com/rust-lang/rust/pull/125023/)
-   [Lint on `foo.into_iter()` resolving to `&Box<[T]>: IntoIterator`](https://togithub.com/rust-lang/rust/pull/124097/)

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

## Libraries

-   [Add `size_of` and `size_of_val` and `align_of` and `align_of_val` to the prelude](https://togithub.com/rust-lang/rust/pull/123168/)
-   [Abort a process when FD ownership is violated](https://togithub.com/rust-lang/rust/pull/124210/)
-   [io::Write::write_fmt: panic if the formatter fails when the stream does not fail](https://togithub.com/rust-lang/rust/pull/125012/)
-   [Panic if `PathBuf::set_extension` would add a path separator](https://togithub.com/rust-lang/rust/pull/125070/)
-   [Add assert_unsafe_precondition to unchecked\_{add,sub,neg,mul,shl,shr} methods](https://togithub.com/rust-lang/rust/pull/121571/)
-   [Update `c_char` on AIX to use the correct type](https://togithub.com/rust-lang/rust/pull/122986/)
-   [`offset_of!` no longer returns a temporary](https://togithub.com/rust-lang/rust/pull/124484/)
-   [Handle sigma in `str.to_lowercase` correctly](https://togithub.com/rust-lang/rust/pull/124773/)
-   [Raise `DEFAULT_MIN_STACK_SIZE` to at least 64KiB](https://togithub.com/rust-lang/rust/pull/126059/)

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

## Stabilized APIs

-   [`impl Default for Rc<CStr>`](https://doc.rust-lang.org/beta/alloc/rc/struct.Rc.html#impl-Default-for-Rc%3CCStr%3E)
-   [`impl Default for Rc<str>`](https://doc.rust-lang.org/beta/alloc/rc/struct.Rc.html#impl-Default-for-Rc%3Cstr%3E)
-   [`impl Default for Rc<[T]>`](https://doc.rust-lang.org/beta/alloc/rc/struct.Rc.html#impl-Default-for-Rc%3C%5BT%5D%3E)
-   [`impl Default for Arc<str>`](https://doc.rust-lang.org/beta/alloc/sync/struct.Arc.html#impl-Default-for-Arc%3Cstr%3E)
-   [`impl Default for Arc<CStr>`](https://doc.rust-lang.org/beta/alloc/sync/struct.Arc.html#impl-Default-for-Arc%3CCStr%3E)
-   [`impl Default for Arc<[T]>`](https://doc.rust-lang.org/beta/alloc/sync/struct.Arc.html#impl-Default-for-Arc%3C%5BT%5D%3E)
-   [`impl IntoIterator for Box<[T]>`](https://doc.rust-lang.org/beta/alloc/boxed/struct.Box.html#impl-IntoIterator-for-Box%3C%5BI%5D,+A%3E)
-   [`impl FromIterator<String> for Box<str>`](https://doc.rust-lang.org/beta/alloc/boxed/struct.Box.html#impl-FromIterator%3CString%3E-for-Box%3Cstr%3E)
-   [`impl FromIterator<char> for Box<str>`](https://doc.rust-lang.org/beta/alloc/boxed/struct.Box.html#impl-FromIterator%3Cchar%3E-for-Box%3Cstr%3E)
-   [`LazyCell`](https://doc.rust-lang.org/beta/core/cell/struct.LazyCell.html)
-   [`LazyLock`](https://doc.rust-lang.org/beta/std/sync/struct.LazyLock.html)
-   [`Duration::div_duration_f32`](https://doc.rust-lang.org/beta/std/time/struct.Duration.html#method.div_duration_f32)
-   [`Duration::div_duration_f64`](https://doc.rust-lang.org/beta/std/time/struct.Duration.html#method.div_duration_f64)
-   [`Option::take_if`](https://doc.rust-lang.org/beta/std/option/enum.Option.html#method.take_if)
-   [`Seek::seek_relative`](https://doc.rust-lang.org/beta/std/io/trait.Seek.html#method.seek_relative)
-   [`BinaryHeap::as_slice`](https://doc.rust-lang.org/beta/std/collections/struct.BinaryHeap.html#method.as_slice)
-   [`NonNull::offset`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.offset)
-   [`NonNull::byte_offset`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_offset)
-   [`NonNull::add`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.add)
-   [`NonNull::byte_add`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_add)
-   [`NonNull::sub`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.sub)
-   [`NonNull::byte_sub`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_sub)
-   [`NonNull::offset_from`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.offset_from)
-   [`NonNull::byte_offset_from`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_offset_from)
-   [`NonNull::read`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.read)
-   [`NonNull::read_volatile`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.read_volatile)
-   [`NonNull::read_unaligned`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.read_unaligned)
-   [`NonNull::write`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write)
-   [`NonNull::write_volatile`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write_volatile)
-   [`NonNull::write_unaligned`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write_unaligned)
-   [`NonNull::write_bytes`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write_bytes)
-   [`NonNull::copy_to`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_to)
-   [`NonNull::copy_to_nonoverlapping`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_to_nonoverlapping)
-   [`NonNull::copy_from`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_from)
-   [`NonNull::copy_from_nonoverlapping`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_from_nonoverlapping)
-   [`NonNull::replace`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.replace)
-   [`NonNull::swap`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.swap)
-   [`NonNull::drop_in_place`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.drop_in_place)
-   [`NonNull::align_offset`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.align_offset)
-   [`<[T]>::split_at_checked`](https://doc.rust-lang.org/beta/std/primitive.slice.html#method.split_at_checked)
-   [`<[T]>::split_at_mut_checked`](https://doc.rust-lang.org/beta/std/primitive.slice.html#method.split_at_mut_checked)
-   [`str::split_at_checked`](https://doc.rust-lang.org/beta/std/primitive.str.html#method.split_at_checked)
-   [`str::split_at_mut_checked`](https://doc.rust-lang.org/beta/std/primitive.str.html#method.split_at_mut_checked)
-   [`str::trim_ascii`](https://doc.rust-lang.org/beta/std/primitive.str.html#method.trim_ascii)
-   [`str::trim_ascii_start`](https://doc.rust-lang.org/beta/std/primitive.str.html#method.trim_ascii_start)
-   [`str::trim_ascii_end`](https://doc.rust-lang.org/beta/std/primitive.str.html#method.trim_ascii_end)
-   [`<[u8]>::trim_ascii`](https://doc.rust-lang.org/beta/core/primitive.slice.html#method.trim_ascii)
-   [`<[u8]>::trim_ascii_start`](https://doc.rust-lang.org/beta/core/primitive.slice.html#method.trim_ascii_start)
-   [`<[u8]>::trim_ascii_end`](https://doc.rust-lang.org/beta/core/primitive.slice.html#method.trim_ascii_end)
-   [`Ipv4Addr::BITS`](https://doc.rust-lang.org/beta/core/net/struct.Ipv4Addr.html#associatedconstant.BITS)
-   [`Ipv4Addr::to_bits`](https://doc.rust-lang.org/beta/core/net/struct.Ipv4Addr.html#method.to_bits)
-   [`Ipv4Addr::from_bits`](https://doc.rust-lang.org/beta/core/net/struct.Ipv4Addr.html#method.from_bits)
-   [`Ipv6Addr::BITS`](https://doc.rust-lang.org/beta/core/net/struct.Ipv6Addr.html#associatedconstant.BITS)
-   [`Ipv6Addr::to_bits`](https://doc.rust-lang.org/beta/core/net/struct.Ipv6Addr.html#method.to_bits)
-   [`Ipv6Addr::from_bits`](https://doc.rust-lang.org/beta/core/net/struct.Ipv6Addr.html#method.from_bits)
-   [`Vec::<[T; N]>::into_flattened`](https://doc.rust-lang.org/beta/alloc/vec/struct.Vec.html#method.into_flattened)
-   [`<[[T; N]]>::as_flattened`](https://doc.rust-lang.org/beta/core/primitive.slice.html#method.as_flattened)
-   [`<[[T; N]]>::as_flattened_mut`](https://doc.rust-lang.org/beta/core/primitive.slice.html#method.as_flattened_mut)

These APIs are now stable in const contexts:

-   [`<[T]>::last_chunk`](https://doc.rust-lang.org/beta/core/primitive.slice.html#method.last_chunk)
-   [`BinaryHeap::new`](https://doc.rust-lang.org/beta/std/collections/struct.BinaryHeap.html#method.new)

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

## Cargo

-   [Stabilize `-Zcheck-cfg` as always enabled](https://togithub.com/rust-lang/cargo/pull/13571/)
-   [Warn, rather than fail publish, if a target is excluded](https://togithub.com/rust-lang/cargo/pull/13713/)
-   [Add special `check-cfg` lint config for the `unexpected_cfgs` lint](https://togithub.com/rust-lang/cargo/pull/13913/)
-   [Stabilize `cargo update --precise <yanked>`](https://togithub.com/rust-lang/cargo/pull/13974/)
-   [Don't change file permissions on `Cargo.toml` when using `cargo add`](https://togithub.com/rust-lang/cargo/pull/13898/)
-   [Support using `cargo fix` on IPv6-only networks](https://togithub.com/rust-lang/cargo/pull/13907/)

<a id="1.80-Rustdoc"></a>

## Rustdoc

-   [Allow searching for references](https://togithub.com/rust-lang/rust/pull/124148/)
-   [Stabilize `custom_code_classes_in_docs` feature](https://togithub.com/rust-lang/rust/pull/124577/)
-   [fix: In cross-crate scenarios show enum variants on type aliases of enums](https://togithub.com/rust-lang/rust/pull/125300/)

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

## Compatibility Notes

-   [rustfmt estimates line lengths differently when using non-ascii characters](https://togithub.com/rust-lang/rustfmt/issues/6203)
-   [Type aliases are now handled correctly in orphan check](https://togithub.com/rust-lang/rust/pull/117164/)
-   [Allow instructing rustdoc to read from stdin via `-`](https://togithub.com/rust-lang/rust/pull/124611/)
-   [`std::env::{set_var, remove_var}` can no longer be converted to safe function pointers and no longer implement the `Fn` family of traits](https://togithub.com/rust-lang/rust/pull/124636)
-   [Warn (or error) when `Self` constructor from outer item is referenced in inner nested item](https://togithub.com/rust-lang/rust/pull/124187/)
-   [Turn `indirect_structural_match` and `pointer_structural_match` lints into hard errors](https://togithub.com/rust-lang/rust/pull/124661/)
-   [Make `where_clause_object_safety` lint a regular object safety violation](https://togithub.com/rust-lang/rust/pull/125380/)
-   [Turn `proc_macro_back_compat` lint into a hard error.](https://togithub.com/rust-lang/rust/pull/125596/)
-   [Detect unused structs even when implementing private traits](https://togithub.com/rust-lang/rust/pull/122382/)
-   [`std::sync::ReentrantLockGuard<T>` is no longer `Sync` if `T: !Sync`](https://togithub.com/rust-lang/rust/pull/125527) which means [`std::io::StdoutLock` and `std::io::StderrLock` are no longer Sync](https://togithub.com/rust-lang/rust/issues/127340)

<a id="1.80-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.

-   Misc improvements to size of generated html by rustdoc e.g. [#&#8203;124738](https://togithub.com/rust-lang/rust/pull/124738/) and [#&#8203;123734](https://togithub.com/rust-lang/rust/pull/123734/)
-   [MSVC targets no longer depend on libc](https://togithub.com/rust-lang/rust/pull/124050/)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* * * * *" (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.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired.

---

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

---

This PR was generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View the [repository job log](https://developer.mend.io/github/rust-lang/cargo).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjQzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->
2024-07-29 13:32:31 +00:00
bors
59c6fad380 Auto merge of #14315 - ehuss:windows-warnings, r=weihanglo
Fix warnings building tests on Windows

This fixes a few warnings when building cargo's testsuite on Windows due to some imports only being used inside some `cfg` elided tests.
2024-07-28 22:39:39 +00:00
Eric Huss
9ccd7c4f36 Fix warnings building tests on Windows 2024-07-28 13:00:26 -07:00
Ed Page
d62fcae81d chore: Bump versions 2024-07-26 16:32:54 -05:00
bors
b5d44db1da Auto merge of #13947 - tweag:package-workspace, r=epage
Package workspaces

Adds support for packaging an entire workspace, even when there are dependencies between the crates. The generated packages should be identical to the ones produced by packaging and publishing the crates one-by-one in dependency order, but the main benefit of this PR is that the packages can be created and verified locally before anything is published.

The main mechanism is the one in #13926, where we create a temporary local registry that "overlays" the true registry. We "publish" the crates in the local registry, which enables lockfile generation and verification of the dependent crates.

This adds `--registry` and `--index` flags to `cargo package`. They act
much like the same arguments to `cargo publish`, except that of course
we are not actually publishing to the specified registry. Instead, these
arguments affect lock-file generation for intra-workspace dependencies:
when simultaneously packaging a crate and one of its dependencies, the
lock-file will be generated under the assumption that the dependency
will be published to the specified registry.

You can also publish a subset of a workspace using `-p` arguments. In this case, there will be an error unless the chosen subset contains all of the dependencies of everything in the subset.

Fixes #10948. Based on #13926.

### Compatibility issue

This PR introduces a case where `cargo package` will fail where it did not before: if you have a workspace containing two packages, `main` and `dep@0.1.0`, where `main` depends on `dep@0.1.0` and `dep@0.1.0` is already published in crates.io then attempting to package the whole workspace will fail. To be specific, it will package `dep@0.1.0` successfully and then fail when trying to package `main` because it will see the two different packages for `dep@0.1.0`. Note that `cargo publish` will already fail in this scenario.

This shouldn't interfere with crates.io running `cargo package` for each package to diff the `.crate` files
- This might interfere if someone tried to verify their "published" MSRV by running `cargo package`.

The failure could be avoided by changing the local overlay source to not error out if there's a duplicate package; see [here](https://github.com/rust-lang/cargo/pull/13926#discussion_r1606822615). However, failing early has the advantage of catching errors early.
2024-07-26 21:27:12 +00:00
bors
b9e432ad04 Auto merge of #14242 - eth3lbert:snapbox-messages, r=epage
test: migrate messages to snapbox

### What does this PR try to resolve?

Part of https://github.com/rust-lang/cargo/issues/14039.

Migrate following to snapbox:

- `tests/testsuite/messages.rs`
2024-07-26 15:51:51 +00:00
eth3lbert
f9026f1884
test: migrate messages to snapbox 2024-07-26 23:26:48 +08:00
bors
9a0c8b3ad1 Auto merge of #14299 - epage:deps, r=weihanglo
chore: Update dependencies

I just published all of my packages using Cargo 1.80 and wanted to see the effect of the enumerating targets during publish (#13849).
2024-07-26 13:02:31 +00:00
renovate[bot]
74f01c4b65
chore(deps): update msrv 2024-07-26 12:52:37 +00:00
bors
4f19191528 Auto merge of #14302 - weihanglo:check-cfg, r=epage
fix: remove rustc probe for `--check-cfg` support

### What does this PR try to resolve?

This is a follow-up to #13571 as now everything for `-Z check-cfg` is stabilized.

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

Existing test suite passes.

### Additional information
2024-07-25 18:39:26 +00:00
Weihang Lo
acf64f72b6
fix: remove rustc probe for --check-cfg support 2024-07-25 12:28:08 -04:00
Ed Page
fa5853a397 chore: Bump rustfix 2024-07-25 10:31:21 -05:00
Ed Page
2a104dcb31 chore: Move rustfix's similar dep to workspace 2024-07-25 10:30:40 -05:00
Ed Page
8debb544e4 chore: Update dependencies
I just published all of my packages using Cargo 1.80 and wanted to see
the effect of the enumerating targets during publish (#13849).
2024-07-25 10:04:10 -05:00
bors
0d0bab6d9f Auto merge of #14297 - epage:test-json, r=weihanglo
Misc test clean up

### What does this PR try to resolve?

Part of this is a follow up to #14293.

Part of this is a follow up to some of #14039's work.

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

### Additional information
2024-07-25 00:13:24 +00:00
Ed Page
922cfe5759 fix(test): Remove unused deprecated function 2024-07-24 16:35:11 -05:00
Ed Page
96a5897e91 test: Migrate another 'test' json test
Rather than blocking on assert-rs/snapbox#351, we can get away with
`--no-run` for what this test is covering.
2024-07-24 16:34:22 -05:00
bors
a7917fdc3a Auto merge of #14250 - linyihai:update-breaking-prerelease, r=weihanglo
Don't downgrade on prerelease `VersionReq` when update with --breaking.

### What does this PR try to resolve?
Do nothing with prerelease when update with `--breaking`.

Fixes https://github.com/rust-lang/cargo/issues/14178

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

Previous commit add a test, next commit to fix and update.

### Additional information
2024-07-24 19:09:05 +00:00
bors
9bda502d60 Auto merge of #14293 - epage:jsonlines, r=weihanglo
test: Migrate some json tests to snapbox

### What does this PR try to resolve?

This builds on assert-rs/snapbox#348 and is part of #14039.

Note: this also updates existing `.is_jsonlines()` usage to `.is_json().against_jsonlines()`.

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

### Additional information
2024-07-24 18:38:45 +00:00
Ed Page
3085b548ec test: Migrate json install doc to snapbox 2024-07-24 10:42:51 -05:00
Ed Page
65577954ce test: Migrate to pretty jsonlines for bad_manifest_path tests 2024-07-24 10:42:51 -05:00
Ed Page
98c21a666d test: Migrate to pretty jsonlines for binary_name tests 2024-07-24 10:42:51 -05:00
Ed Page
810afa26cb test: Migrate to pretty jsonlines for bench tests 2024-07-24 10:42:51 -05:00
Ed Page
48ca095d19 test: Migrate json install tests to snapbox 2024-07-24 10:42:51 -05:00
Ed Page
cbb3222959 test: Migrate some json test tests to snapbox 2024-07-24 10:42:51 -05:00
Ed Page
ee2d6ccb69 test: Migrate json pkgid tests to snapbox 2024-07-24 10:42:51 -05:00
Ed Page
16448d45d7 doc(test): Document 'with_json' replacement 2024-07-24 10:42:51 -05:00
Ed Page
bb5488c9a0 tests: Update for snapbox deprecations 2024-07-24 10:42:50 -05:00
Ed Page
7c8411cef8 chore: Upgrade snapbox 2024-07-24 10:06:12 -05:00
bors
ca330a26df Auto merge of #14295 - epage:revert, r=weihanglo
Revert "fix: Ensure dep/feature activates the dependency on 2024"

### What does this PR try to resolve?

Fixes #14283 by re-opening #14016 so we don't block people testing other Edition 2024 changes.

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

This reverts commit 99fae9187ac0bae12a03585083169e34dc7a197d.

I initially held off on reverting in case we quickly had a clear direction to go.  Since we're still doing some investigation, I decided to move forward with this.

### Additional information
2024-07-24 13:50:55 +00:00
Ed Page
407a32c11c Revert "fix: Ensure dep/feature activates the dependency on 2024"
Fixes #14283 by re-opening #14016 so we don't block people testing other
Edition 2024 changes.

This reverts commit 99fae9187ac0bae12a03585083169e34dc7a197d.
2024-07-24 08:00:27 -05:00
Joe Neeman
a2f0a9e7d6 Adds support for packaging workspaces.
Takes local dependencies into account when packaging a workspace. Builds
a temporary package registry to provide local dependencies, and overlays
it on the upstream registry.

This adds `--registry` and `--index` flags to `cargo package`. They act
much like the same arguments to `cargo publish`, except that of course
we are not actually publishing to the specified registry. Instead, these
arguments affect lock-file generation for intra-workspace dependencies:
when simultaneously packaging a crate and one of its dependencies, the
lock-file will be generated under the assumption that the dependency
will be published to the specified registry.

Co-Authored-By: Tor Hovland <55164+torhovland@users.noreply.github.com>
2024-07-24 16:36:30 +07:00
Joe Neeman
cbc836d4b0 Add tests showing incorrect workspace packaging.
Co-Authored-By: Tor Hovland <55164+torhovland@users.noreply.github.com>
2024-07-24 16:03:51 +07:00
Joe Neeman
8771230eb8 Factor out a function for building a NewCrate.
Co-Authored-By: Tor Hovland <55164+torhovland@users.noreply.github.com>
2024-07-24 15:17:54 +07:00
Lin Yihai
9e2701aedb fix: Don't downgrade with update --breaking if VersionReq is prerelease 2024-07-23 14:38:36 +08:00
Lin Yihai
89b0119772 test: Add test about update --breaking on prerelease 2024-07-23 14:38:36 +08:00
bors
7f2079838a Auto merge of #14286 - weihanglo:cargo-test-support, r=ehuss
chore: bump cargo-test-support to 0.4.0

### What does this PR try to resolve?

These PRs have contributed to major changes:

* https://github.com/rust-lang/cargo/pull/14266
* https://github.com/rust-lang/cargo/pull/14269
* https://github.com/rust-lang/cargo/pull/14270

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

### Additional information

Error log:

```
    Checking cargo-test-support v0.3.0 -> v0.3.1 (minor change)
     Checked [   0.079s] 66 checks; 63 passed, 3 failed, 6 unnecessary

--- failure function_missing: pub fn removed or renamed ---

Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.31.0/src/lints/function_missing.ron

Failed in:
  function cargo_test_support::install::cargo_home, previously in file /projects/cargo/target/semver-checks/git-a2b58c3dad4d554ba01ed6c45c41ff85390560f2/e5a046bb78236b6c7eddf006d3a5ac7b4a5593aa/crates/cargo-test-support/src/install.rs:27
  function cargo_test_support::path2url, previously in file /projects/cargo/target/semver-checks/git-a2b58c3dad4d554ba01ed6c45c41ff85390560f2/e5a046bb78236b6c7eddf006d3a5ac7b4a5593aa/crates/cargo-test-support/src/lib.rs:1187

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.31.0/src/lints/struct_missing.ron

Failed in:
  struct cargo_test_support::RawOutput, previously in file /projects/cargo/target/semver-checks/git-a2b58c3dad4d554ba01ed6c45c41ff85390560f2/e5a046bb78236b6c7eddf006d3a5ac7b4a5593aa/crates/cargo-test-support/src/lib.rs:524

--- failure trait_missing: pub trait removed or renamed ---

Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.31.0/src/lints/trait_missing.ron

Failed in:
  trait cargo_test_support::TestEnv, previously in file /projects/cargo/target/semver-checks/git-a2b58c3dad4d554ba01ed6c45c41ff85390560f2/e5a046bb78236b6c7eddf006d3a5ac7b4a5593aa/crates/cargo-test-support/src/lib.rs:1272
  trait cargo_test_support::prelude::TestEnv, previously in file /projects/cargo/target/semver-checks/git-a2b58c3dad4d554ba01ed6c45c41ff85390560f2/e5a046bb78236b6c7eddf006d3a5ac7b4a5593aa/crates/cargo-test-support/src/lib.rs:1272
  trait cargo_test_support::ChannelChanger, previously in file /projects/cargo/target/semver-checks/git-a2b58c3dad4d554ba01ed6c45c41ff85390560f2/e5a046bb78236b6c7eddf006d3a5ac7b4a5593aa/crates/cargo-test-support/src/lib.rs:1252
  trait cargo_test_support::prelude::ChannelChanger, previously in file /projects/cargo/target/semver-checks/git-a2b58c3dad4d554ba01ed6c45c41ff85390560f2/e5a046bb78236b6c7eddf006d3a5ac7b4a5593aa/crates/cargo-test-support/src/lib.rs:1252
  trait cargo_test_support::CargoCommand, previously in file /projects/cargo/target/semver-checks/git-a2b58c3dad4d554ba01ed6c45c41ff85390560f2/e5a046bb78236b6c7eddf006d3a5ac7b4a5593aa/crates/cargo-test-support/src/lib.rs:1388
  trait cargo_test_support::prelude::CargoCommand, previously in file /projects/cargo/target/semver-checks/git-a2b58c3dad4d554ba01ed6c45c41ff85390560f2/e5a046bb78236b6c7eddf006d3a5ac7b4a5593aa/crates/cargo-test-support/src/lib.rs:1388
  trait cargo_test_support::ArgLine, previously in file /projects/cargo/target/semver-checks/git-a2b58c3dad4d554ba01ed6c45c41ff85390560f2/e5a046bb78236b6c7eddf006d3a5ac7b4a5593aa/crates/cargo-test-support/src/lib.rs:1402
  trait cargo_test_support::prelude::ArgLine, previously in file /projects/cargo/target/semver-checks/git-a2b58c3dad4d554ba01ed6c45c41ff85390560f2/e5a046bb78236b6c7eddf006d3a5ac7b4a5593aa/crates/cargo-test-support/src/lib.rs:1402
     Summary semver requires new major version: 3 major and 0 minor checks failed
```
2024-07-22 20:06:20 +00:00
Weihang Lo
ab8ac44b49
chore: bump cargo-test-support to 0.4.0 2024-07-22 15:37:13 -04:00
bors
3f3ee161cf Auto merge of #14285 - weihanglo:version-bump, r=epage
Bump to 0.83.0; update changelog
2024-07-22 19:24:48 +00:00
Weihang Lo
3203e4fed8
docs: update changelog for 1.82.0 2024-07-22 15:17:32 -04:00
Weihang Lo
fb3c5c4622
docs: update changelog for 1.81.0 2024-07-22 15:17:32 -04:00
bors
8a8b99f06d Auto merge of #14279 - tweag:improved-error-message-invalid-spec-update-breaking, r=weihanglo
Improved error message when `update --breaking` invalid spec.

Improves an error message when trying to do `cargo update --breaking clap@foo`:

```
- [ERROR] expected a version like "1.32"
+ [ERROR] invalid package ID specification: `clap@foo`
+ Caused by:
+   expected a version like "1.32"
```

Related to #12425. Fixes an item [here](https://github.com/rust-lang/cargo/issues/12425#issuecomment-2186198258), as noted [here](https://github.com/rust-lang/cargo/pull/14049#discussion_r1656929921).
2024-07-22 18:40:20 +00:00