17004 Commits

Author SHA1 Message Date
Paul Mabileau
01e1fe247b
Chore(Cargo.toml): Add versions for cargo-test-*
Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2024-03-26 11:17:27 +01:00
Paul Mabileau
2879fc0d60
Chore(cargo-test-*/Cargo.toml): Bump MSRVs to make corresponding CI check pass
Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2024-03-26 11:16:12 +01:00
Paul Mabileau
d691d034c7
Chore(cargo-test-*/Cargo.toml): Bump versions to make ci/validate-version-bump.sh pass
Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2024-03-26 11:14:14 +01:00
Paul Mabileau
f9b5702755
Chore(cargo-test-*/Cargo.toml): Standardize basic fields for publication
Marks the crates as publishable.

Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2024-03-26 11:11:51 +01:00
Paul Mabileau
80300763b1
Chore(cargo-test-*): Add license file links
Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2024-03-26 11:09:32 +01:00
bors
499a61ce7a Auto merge of #13647 - weihanglo:shell, r=Muscraft
fix: do not borrow shell across registry query
2024-03-26 04:17:04 +00:00
Weihang Lo
667803c741
fix: do not borrow shell across registry query 2024-03-25 23:28:10 -04:00
bors
fa619a9d16 Auto merge of #13630 - Kobzol:msvc-disable-release-strip, r=weihanglo
Do not strip debuginfo by default for MSVC

This PR disables the logic which enables debuginfo stripping by default in release mode (https://github.com/rust-lang/cargo/pull/13257) for MSVC, since it causes problems there (https://github.com/rust-lang/rust/issues/122857).

I'm not sure if this is the correct way to gate the logic on a specific target triple.

The root of the issue is that `-Cstrip=debuginfo` currently behaves like `-Cstrip=symbols` on MSVC, which causes the original optimization to break backtraces on Windows. Ultimately, this should probably be fixed in `rustc`, but that might take some further design work, therefore a faster solution would be to just special case this in Cargo for now, and remove the special case later, once it gets fixed on the `rustc` side.

Related issue: https://github.com/rust-lang/rust/issues/122857
2024-03-26 00:22:51 +00:00
Jakub Beránek
53a0dc4aa2
Fix tests 2024-03-25 23:42:47 +01:00
bors
1f6857dcfb Auto merge of #13577 - 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.76.0` -> `1.77` |  |
| [MSRV:3](https://togithub.com/rust-lang/rust) | minor | `1.73` -> `1.75` | `1.77` (+1) |

---

### Release Notes

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

### [`v1.77`](https://togithub.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1770-2024-03-21)

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

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

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

## Language

-   [Reveal opaque types within the defining body for exhaustiveness checking.](https://togithub.com/rust-lang/rust/pull/116821/)
-   [Stabilize C-string literals.](https://togithub.com/rust-lang/rust/pull/117472/)
-   [Stabilize THIR unsafeck.](https://togithub.com/rust-lang/rust/pull/117673/)
-   [Add lint `static_mut_refs` to warn on references to mutable statics.](https://togithub.com/rust-lang/rust/pull/117556/)
-   [Support async recursive calls (as long as they have indirection).](https://togithub.com/rust-lang/rust/pull/117703/)
-   [Undeprecate lint `unstable_features` and make use of it in the compiler.](https://togithub.com/rust-lang/rust/pull/118639/)
-   [Make inductive cycles in coherence ambiguous always.](https://togithub.com/rust-lang/rust/pull/118649/)
-   [Get rid of type-driven traversal in const-eval interning](https://togithub.com/rust-lang/rust/pull/119044/),
    only as a [future compatiblity lint](https://togithub.com/rust-lang/rust/pull/122204) for now.
-   [Deny braced macro invocations in let-else.](https://togithub.com/rust-lang/rust/pull/119062/)

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

## Compiler

-   [Include lint `soft_unstable` in future breakage reports.](https://togithub.com/rust-lang/rust/pull/116274/)
-   [Make `i128` and `u128` 16-byte aligned on x86-based targets.](https://togithub.com/rust-lang/rust/pull/116672/)
-   [Use `--verbose` in diagnostic output.](https://togithub.com/rust-lang/rust/pull/119129/)
-   [Improve spacing between printed tokens.](https://togithub.com/rust-lang/rust/pull/120227/)
-   [Merge the `unused_tuple_struct_fields` lint into `dead_code`.](https://togithub.com/rust-lang/rust/pull/118297/)
-   [Error on incorrect implied bounds in well-formedness check](https://togithub.com/rust-lang/rust/pull/118553/),
    with a temporary exception for Bevy.
-   [Fix coverage instrumentation/reports for non-ASCII source code.](https://togithub.com/rust-lang/rust/pull/119033/)
-   [Fix `fn`/`const` items implied bounds and well-formedness check.](https://togithub.com/rust-lang/rust/pull/120019/)
-   [Promote `riscv32{im|imafc}-unknown-none-elf` targets to tier 2.](https://togithub.com/rust-lang/rust/pull/118704/)
-   Add several new tier 3 targets:
    -   [`aarch64-unknown-illumos`](https://togithub.com/rust-lang/rust/pull/112936/)
    -   [`hexagon-unknown-none-elf`](https://togithub.com/rust-lang/rust/pull/117601/)
    -   [`riscv32imafc-esp-espidf`](https://togithub.com/rust-lang/rust/pull/119738/)
    -   [`riscv32im-risc0-zkvm-elf`](https://togithub.com/rust-lang/rust/pull/117958/)

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

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

## Libraries

-   [Implement `From<&[T; N]>` for `Cow<[T]>`.](https://togithub.com/rust-lang/rust/pull/113489/)
-   [Remove special-case handling of `vec.split_off(0)`.](https://togithub.com/rust-lang/rust/pull/119917/)

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

## Stabilized APIs

-   [`array::each_ref`](https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_ref)
-   [`array::each_mut`](https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_mut)
-   [`core::net`](https://doc.rust-lang.org/stable/core/net/index.html)
-   [`f32::round_ties_even`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.round_ties_even)
-   [`f64::round_ties_even`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.round_ties_even)
-   [`mem::offset_of!`](https://doc.rust-lang.org/stable/std/mem/macro.offset_of.html)
-   [`slice::first_chunk`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.first_chunk)
-   [`slice::first_chunk_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.first_chunk_mut)
-   [`slice::split_first_chunk`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_first_chunk)
-   [`slice::split_first_chunk_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_first_chunk_mut)
-   [`slice::last_chunk`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.last_chunk)
-   [`slice::last_chunk_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.last_chunk_mut)
-   [`slice::split_last_chunk`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_last_chunk)
-   [`slice::split_last_chunk_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_last_chunk_mut)
-   [`slice::chunk_by`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.chunk_by)
-   [`slice::chunk_by_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.chunk_by_mut)
-   [`Bound::map`](https://doc.rust-lang.org/stable/std/ops/enum.Bound.html#method.map)
-   [`File::create_new`](https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.create_new)
-   [`Mutex::clear_poison`](https://doc.rust-lang.org/stable/std/sync/struct.Mutex.html#method.clear_poison)
-   [`RwLock::clear_poison`](https://doc.rust-lang.org/stable/std/sync/struct.RwLock.html#method.clear_poison)

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

## Cargo

-   [Extend the build directive syntax with `cargo::`.](https://togithub.com/rust-lang/cargo/pull/12201/)
-   [Stabilize metadata `id` format as `PackageIDSpec`.](https://togithub.com/rust-lang/cargo/pull/12914/)
-   [Pull out `cargo-util-schemas` as a crate.](https://togithub.com/rust-lang/cargo/pull/13178/)
-   [Strip all debuginfo when debuginfo is not requested.](https://togithub.com/rust-lang/cargo/pull/13257/)
-   [Inherit jobserver from env for all kinds of runners.](https://togithub.com/rust-lang/cargo/pull/12776/)
-   [Deprecate rustc plugin support in cargo.](https://togithub.com/rust-lang/cargo/pull/13248/)

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

## Rustdoc

-   [Allows links in markdown headings.](https://togithub.com/rust-lang/rust/pull/117662/)
-   [Search for tuples and unit by type with `()`.](https://togithub.com/rust-lang/rust/pull/118194/)
-   [Clean up the source sidebar's hide button.](https://togithub.com/rust-lang/rust/pull/119066/)
-   [Prevent JS injection from `localStorage`.](https://togithub.com/rust-lang/rust/pull/120250/)

<a id="1.77.0-Misc"></a>

## Misc

-   [Recommend version-sorting for all sorting in style guide.](https://togithub.com/rust-lang/rust/pull/115046/)

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

-   [Add more weirdness to `weird-exprs.rs`.](https://togithub.com/rust-lang/rust/pull/119028/)

</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 has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/rust-lang/cargo).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMzguMSIsInVwZGF0ZWRJblZlciI6IjM3LjI2MS4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=-->
2024-03-25 21:16:58 +00:00
bors
c56140f646 Auto merge of #13640 - ehuss:fix-doc-dash-collision, r=epage
Fix doc collision for lib/bin with a dash in the inferred name.

This fixes an issue where `cargo doc` would report a collision if the project has a `-` in the name, and both a lib and bin. As a consequence of the change in #12783, the target name for the library no longer has a `-`. The code that checks for the lib/bin doc collision was only checking if the target names were equal, which is no longer the case after #12783. The solution here is to use the `crate_name` and not the target name, which has the appropriate `_` translation done. This is the more correct method to use, even before #12783, because rustdoc uses crate names, not target names (and thus even documenting bins have their filenames converted to underscores).

Fixes #13628
2024-03-25 20:43:52 +00:00
Eric Huss
3adb796e87 Fix doc collision for lib/bin with a dash in the inferred name. 2024-03-25 13:35:52 -07:00
Eric Huss
9e7d6e3122 Add test for doc lib/bin collision with a dash. 2024-03-25 13:32:15 -07:00
Ed Page
451babb370 chore: Bump versions 2024-03-25 14:13:38 -05:00
renovate[bot]
ccc31b4ddf chore(deps): update msrv 2024-03-25 14:13:38 -05:00
bors
bc844af45d Auto merge of #13635 - Muscraft:lint-names-snake-case, r=epage
refactor: Make lint names snake_case

When working on #13621, I somehow missed that lint names should be `snake_case` according to the [`rustc-dev-guide`](https://rustc-dev-guide.rust-lang.org/diagnostics.html#lint-naming) as well as [`RFC #344`](https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints).

This PR renames:
- `implicit-features` => `implicit_featires`
- `rust-2024-compatibility` => `rust_2024_compatibility`.

<hr>

Note: We should probably have some tooling to enforce this, but I was unsure if it belonged to this PR or another one. One solution would be to use a macro to create the `const LINT_NAME: Lint = {...}`, where `LINT_NAME` would be the `ident` as well as the `name: &'static str` and then have a method on `Lint` to make it lowercase as needed. This is what `rustc` does, and it could work well here. It would ensure snake case as `const` names need to be [`SCREAMING_SNAKE_CASE`](https://rust-lang.github.io/rfcs/0430-finalizing-naming-conventions.html#general-naming-conventions), or a warning is shown.
2024-03-25 18:51:29 +00:00
Scott Schafer
0a400d5ef0
refactor: Make lint names snake_case 2024-03-25 12:44:12 -06:00
bors
a510712d05 Auto merge of #13637 - jhpratt:master, r=weihanglo
Remove unnecessary test

This removes a test that is blocking rust-lang/rust#116016 from landing. `@dtolnay` suggested removing the test rather than allowing the relevant lints ([comment](https://github.com/rust-lang/rust/pull/116016#issuecomment-2016649022)).

> The failure is in 77506e5739/tests/testsuite/check.rs (L222-L285) which is a 7 year old test for [rust-lang/cargo#3419](https://github.com/rust-lang/cargo/issues/3419), which is from 2 days after the initial implementation of `cargo check` landed in nightly Cargo in [rust-lang/cargo#3296](https://github.com/rust-lang/cargo/pull/3296).
>
> I would recommend just deleting the test from Cargo. The implementation of `cargo check` has matured enough since then and I don't see anything useful in that test.
2024-03-25 03:45:54 +00:00
Jacob Pratt
def06ee243
Remove unnecessary test 2024-03-24 20:02:10 -04:00
bors
a5b31ebafa Auto merge of #13592 - Byron:gix-for-list-files-git, r=arlosi
Use `gitoxide` for `list_files_git`

Related to #10150.

### Tasks

* [x] update `gix` to v0.60
* [x] assure this is tested (currently only git-tests run with `git2` and `gitoxide`)
* [x] allow `list_files_git` to use `gitoxide` if it is enabled as feature.
* [x] use dirwalk iterator
* [x] use new release of `gix` with necessary updates

### Review Notes

As this PR has come a long way, I decided to keep a few of the steps leading up to the final state, showing the PR's evolution in the hope it helps the review.

* Would it be better to simply use `gitoxide` for this without a switch? I don't think
  it will cause more trouble than `git2`, and if there is an issue I will fix it with priority.
* In one test, the walk resolves a symlink to a submodule to individual files, including the `.git/*` folder contained in the submodule which is ignored by the walk, i.e. `submodule/*` does not contain it, but `submodule-link/*` does. This is fixed in the gitoxide version, and the `git2` version.
* I noticed that symlinks are resolved for packaging *and* are allowed to point to anywhere, even outside of package root. I left it, but felt that maybe this should be reconsidered.

### Remarks

* I love the test-suite! It's incredibly exhaustive to the point where it uncovers shortcomings in `gitoxide`, which I greatly appreciate.
* I also love `git2` as it's API for many things leads to pretty idiomatic code, and sometimes I really have to work to match it. The example here is the initial `dirwalk()` method which requires a delegate as it doesn't just collect into a `Vec` like `git2` does (for good reason). Turning that into an iterator via `dirwalk_iter()` makes it far more usable, and will definitely be good for performance as the dirwalk work is offloaded into its own thread.
2024-03-24 20:01:45 +00:00
Jakub Beránek
ab285e97a0
Do not strip debuginfo by default for MSVC 2024-03-24 09:38:59 +01:00
bors
77506e5739 Auto merge of #13632 - Muscraft:fix-lints-z-flag, r=ehuss
fix: Warn on -Zlints

When the `[lints]` table was stabilized in #12648, it appears that making `-Zlints` into a warning when specified was missed, this PR fixes that.
2024-03-23 20:14:02 +00:00
Scott Schafer
c006a307f7
fix: Warn on -Zlints 2024-03-23 13:53:14 -06:00
bors
61855e72a2 Auto merge of #13621 - Muscraft:linting-system, r=weihanglo
feat: Add a basic linting system

This PR adds a basic linting system, the first step towards [User control over cargo warnings](https://github.com/rust-lang/cargo/issues/12235). To demonstrate the system, a lint for #12826 is added. It supports controlling cargo lints via the `[lints.cargo]` table. Lints can be controlled either by a group or individually.

This is meant to lay down some fundamental infrastructure for the whole linting system and is not meant to be fully featured. Over time, features will be added that will help us reach a much more solid state.
2024-03-23 18:39:37 +00:00
Scott Schafer
307c7f825c
feat: Add a basic linting system 2024-03-23 10:26:02 -06:00
Scott Schafer
abf0953292
feat: Add -Zcargo-lints 2024-03-23 10:24:50 -06:00
bors
1728ac594a Auto merge of #13631 - weihanglo:deprecate, r=ehuss
docs: remove untrue TODO for `native_dirs`

`native_dirs` is still in use.
2024-03-23 14:57:21 +00:00
Weihang Lo
1195206581
docs: remove untrue TODO for native_dirs
`native_dirs` is still in use.

See <https://github.com/rust-lang/cargo/pull/6194>
2024-03-23 10:36:40 -04:00
Sebastian Thiel
91781609a5
Assure top-level refspecs and tailing '/' for target prefix
Top-level pathspecs are needed to assure they are not affected by
the CWD. The trailing `/` in `'target` is needed to assure excluded
items are in a folder, and that only entries in that folder are extracted
from the index.
2024-03-23 08:52:12 +01:00
Sebastian Thiel
dbf1b6affd
Simplify pathspec generation in list_files_gix
Co-authored-by: Arlo Siemsen <arkixml@gmail.com>
2024-03-23 08:41:27 +01:00
bors
7ff7e34260 Auto merge of #13627 - Muscraft:rename-lint-table-tests, r=epage
refactor(testsuite): Rename lints to lints_table

In preparation for a linting system for cargo, we need a place to put the tests for new lints. Since they would be UI tests, it would make sense to place them in `tests/testsuite/lints/<lint name>`, but tests for `[lints]` are in `tests/testsuite/lints.rs`. To get around this, I am renaming `lints.rs` to `lints_table.rs` so they do not get confused.
2024-03-22 17:40:06 +00:00
Scott Schafer
31c3052524
refactor(testsuite): Rename lints to lints_table 2024-03-22 11:33:58 -06:00
Sebastian Thiel
ac68aa1c7c
Don't call .ok() before unwrap_or()
It's not necessary, and adds noise.
2024-03-22 07:24:06 +01:00
bors
8bcecfeed4 Auto merge of #13618 - ehuss:always-rebuild-unit-graph, r=epage
Fix debuginfo strip when using `--target`

This fixes an issue where automatic `strip` of debuginfo added in https://github.com/rust-lang/cargo/pull/13257 wasn't working when the `--target` flag was used.

The problem is that the adjustment code was only running in the optimization pass that is done when `--target` is *not* specified.

The solution is to just always run the unit graph rebuild. I believe it should be safe to do so, since the adjustments it makes should be conditional on just the scenarios that matter when `--target` is not specified. The downside is that this might be a small performance hit when `--target` is used. Trying to avoid that I think would be quite challenging.

Fixes #13617
2024-03-21 21:37:26 +00:00
bors
b8b7fa5cd1 Auto merge of #13619 - epage:fold, r=Muscraft
refactor(toml): Push diagnostic complexity on annotate-snippets
2024-03-21 21:05:16 +00:00
Ed Page
69bbb2c1ae refactor(toml): Push diagnostic complex on annotate-snippets 2024-03-21 15:51:32 -05:00
Eric Huss
e0e000e1e5 Fix debuginfo strip when using --target 2024-03-21 13:39:45 -07:00
bors
c3ad639bb9 Auto merge of #13614 - ehuss:fix-cdn-publish, r=weihanglo
Fix publish script due to crates.io CDN change

Now that crates.io goes directly to the CDN, this has changed the HTTP response code when a crate is not found (from 404 to 403). This updates the publish script to handle more error codes to assume something isn't published. This also updates it to go directly to the endpoint instead of through the crates.io redirect.
2024-03-21 16:33:49 +00:00
Eric Huss
97d896fe52 Fix publish script due to crates.io CDN change 2024-03-21 09:32:05 -07:00
bors
d2fbe57b81 Auto merge of #13613 - weihanglo:empty-alias, r=epage
fix(alias): dont panic when resolving an empty alias
2024-03-21 12:56:31 +00:00
Sebastian Thiel
8375cf40ee
assure user and system configuration for .gitignore/exclude files is picked up 2024-03-21 07:07:41 +01:00
Weihang Lo
46214f3c79
fix(alias): dont panic when resolving an empty alias 2024-03-21 00:44:18 -04:00
Weihang Lo
352d8bbe8e
test(alias): panic if alias is empty
This demonstrate the current bad behavior
2024-03-21 00:41:19 -04:00
Sebastian Thiel
acef08407b
add custom feature toggle for gitoxide usage in list_files() 2024-03-20 22:11:27 +01:00
bors
f0ae765191 Auto merge of #13609 - Muscraft:update-annotate-snippets, r=epage
Update annotate snippets

This updates `annotate-snippets` to `0.11.0`, which introduces the new builder API as well as a few rendering fixes.
2024-03-20 21:08:00 +00:00
bors
5b776ec880 Auto merge of #13610 - weihanglo:refactor-vendor, r=epage
refactor(vendor): tiny not important refactors
2024-03-20 19:49:11 +00:00
Weihang Lo
9f96d7b937
refactor: use a dense pattern matching for str 2024-03-20 15:38:25 -04:00
Weihang Lo
75712e1e30
refactor: reuse Package::root() instead 2024-03-20 14:18:05 -04:00
Scott Schafer
f983e2028c
feat: Set term_width for Renderer 2024-03-20 11:01:54 -06:00
Scott Schafer
96bbaa11bf
chore: Update annotate-snippets 2024-03-20 10:42:10 -06:00