Weihang Lo
4a1e2ea539
fix(schemas): Fix 'metadata' JSON Schema ( #15033 )
...
Instead of allowing any type in metadata, we were specifying fields like
`"string": "<any string>"`.
Found this when looking into #15030
<!--
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-01-08 19:05:19 +00:00
Jacob Finkelman
33b49c9d2f
shorten comment on Ord for SourceKind ( #15029 )
...
As discussed in today's cargo meeting, and in
https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/while.20we're.20breaking.20stable.20hash ,
we are keeping the manual impl but shortening the comment about why it
is needed.
2025-01-08 18:17:50 +00:00
Ed Page
d9f65ec218
Make "C"
explicit in extern "C"
. ( #15034 )
...
We're making the `missing_abi` lint a warning in rustc, see:
https://github.com/rust-lang/rust/pull/132397
2025-01-08 17:51:15 +00:00
Jacob Finkelman
06811d8594
manual impl of hash
2025-01-08 17:35:54 +00:00
Jacob Finkelman
d8b7c072c5
shortening the comment
2025-01-08 17:35:42 +00:00
Ed Page
6fe36c20ad
fix(schemas): Make lints.workspace not required
2025-01-08 11:26:39 -06:00
Ed Page
e6114c3395
fix(schema): Include lints sub-tables in packages
...
This was done by upgrading schemars. Hard to tell what else was changed
because of the noise from the other changes in the layout.
Fixes #15030
2025-01-08 11:26:39 -06:00
Ed Page
e48257d3c8
fix(schemas): Fix 'metadata' JSON Schema
...
Found this when looking into #15030
2025-01-08 11:26:27 -06:00
Ed Page
e8f3e5e0f2
chore(schema): Bump version
2025-01-08 11:26:27 -06:00
Mara Bos
a9b50c201b
Make "C"
explicit in extern "C"
.
2025-01-08 18:14:15 +01:00
Weihang Lo
dd59760f8e
test(source_id): make hash snapshot aware
2025-01-07 22:07:26 +00:00
Weihang Lo
b696870dd8
simplify SourceID Ord/Eq ( #14980 )
...
### What does this PR try to resolve?
This is a followup to #14800 . Like that PR, this is a small incremental
change that does not pull its own weight. If this PR is accepted, the
next PR will unlock large performance wins. I am not posting them
together because the logic of why this PR is correct is subtle and
deserves to be discussed and reviewed without unrelated code changes.
### How should we test and review this PR?
All tests pass on all commits. This **should** be reviewed one commit at
a time.
### Additional information
I pushed one commit at a time, so that CI can confirm that the assert
(in the first commit) is never hit.
2025-01-07 19:24:18 +00:00
Ed Page
83615cfa78
Setup cargo environment for cargo rustc --print
( #15026 )
...
It turns out, running `cargo rustc --print cfg -Zunstable-options` (and
the like, https://github.com/rust-lang/cargo/issues/9357 ) fail with
`.cargo/config.toml` setups like
```toml
[build]
# custom target json that lives in `./targets/my-super-cool-target.json`
target = "my-super-cool-target"
[env]
RUST_TARGET_PATH = { value = "./targets", relative = true }
```
resulting in
```
❯ cargo rustc --print cfg -Zunstable-options
error: Error loading target specification: Could not find specification for target "my-super-cool-target". Run `rustc --print target-list` for a list of built-in targets
error: process didn't exit successfully: `C:\Users\lukas\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin\rustc.exe --target my-super-cool-target --print cfg` (exit code: 1)
```
The reason for that is that cargo recognizes the target from the
`.cargo/config` and then implicitly passes that along to the spawned
rustc process, but it does so without passing along the important
environment that is required for the target tuple to make sense.
(can add a test if desired, just tell me where)
2025-01-07 18:39:52 +00:00
Lukas Wirth
b7a0c9dc56
Setup cargo environment for cargo rustc --print
2025-01-07 18:57:54 +01:00
Lukas Wirth
cedab5d9fd
Add test for cargo rustc --print cfg
that relies on an env target
2025-01-07 18:57:03 +01:00
Rustin
9438fe303a
Avoid naming variables str
( #15025 )
...
This renames variables named `str` to other names, to make sure `str`
always refers to a type.
2025-01-07 14:11:18 +00:00
Josh Triplett
1fe4591da3
Avoid naming variables str
...
This renames variables named `str` to other names, to make sure `str`
always refers to a type.
2025-01-07 13:50:15 +02:00
Ed Page
c1febbe121
Bump to 0.87.0; update changelog ( #15022 )
...
[rendered](https://github.com/weihanglo/cargo/blob/version-bump/CHANGELOG.md )
2025-01-07 01:27:29 +00:00
Weihang Lo
6ee4968d2a
docs: update changelog for 1.86.0
2025-01-06 19:54:35 -05:00
Weihang Lo
63f1325fcb
docs: update changelog for 1.85.0
2025-01-06 19:54:35 -05:00
Weihang Lo
637c41e987
chore: bump to 0.87.0
2025-01-06 14:35:04 -05:00
Weihang Lo
12541d6e5e
Update libgit2 to 1.9 ( #15018 )
...
This is a routine update of libgit2 to 1.9.
libgit2 1.9 release notes:
https://github.com/libgit2/libgit2/releases/tag/v1.9.0
git2:
https://github.com/rust-lang/git2-rs/blob/master/CHANGELOG.md#0200---2025-01-04
2025-01-05 02:59:36 +00:00
Eric Huss
f96b7298a7
Update git2
2025-01-04 16:55:32 -08:00
Weihang Lo
0f9e730043
Remove condition on RUSTUP_WINDOWS_PATH_ADD_BIN ( #15017 )
...
This is no longer needed since rustup 1.27.1 which changed the default
to false.
### How should we test and review this PR?
On windows, run `cargo test --test testsuite -- global_cache_tracker`
2025-01-04 20:18:39 +00:00
Weihang Lo
d10e9cdf65
Fix https::self_signed_should_fail for macos ( #15016 )
...
This no longer generates the same error message for the same reason that
it changed for linux in https://github.com/rust-lang/cargo/pull/13970 .
Note that Windows does things slightly differently, and doesn't need
adjustment.
2025-01-04 19:50:59 +00:00
Eric Huss
e6ecef6cc8
Remove condition on RUSTUP_WINDOWS_PATH_ADD_BIN
...
This is no longer needed since rustup 1.27.1 which changed the default
to false.
2025-01-04 11:49:20 -08:00
Eric Huss
506f409a2e
Fix https::self_signed_should_fail for macos
...
This no longer generates the same error message for the same reason that
it changed for linux in https://github.com/rust-lang/cargo/pull/13970 .
Note that Windows does things slightly differently, and doesn't need
adjustment.
2025-01-04 11:19:35 -08:00
Kornel
973cd5338e
Update autogenerated files
2025-01-04 14:37:39 +00:00
Urgau
208f817c83
Add preparatory tests for lib.test = false
check-cfg changes
2025-01-04 13:42:59 +01:00
Kornel
22690a3236
Make --allow-dirty imply --allow-staged
2025-01-04 00:25:41 +00:00
Ed Page
fd784878cf
chore: bump gix-lock to remove thiserror@1 from cargo
( #15012 )
...
### What does this PR try to resolve?
A follow-up of #14998
Other dev tools for cargo development are fine keeping v1. They are not
shipped to end users.
Before
```
$ cargo tree --workspace -i thiserror@1.0.63
thiserror v1.0.63
├── cargo_metadata v0.19.0
│ └── capture v0.1.0 (/projects/cargo/benches/capture)
├── gix-lock v15.0.0
│ ├── gix v0.69.1
│ │ └── cargo v0.86.0 (/projects/cargo)
│ │ ├── benchsuite v0.0.0 (/projects/cargo/benches/benchsuite)
│ │ ├── resolver-tests v0.0.0 (/projects/cargo/crates/resolver-tests)
│ │ ├── xtask-bump-check v0.0.0 (/projects/cargo/crates/xtask-bump-check)
│ │ └── xtask-lint-docs v0.1.0 (/projects/cargo/crates/xtask-lint-docs)
│ │ [dev-dependencies]
│ │ └── cargo v0.86.0 (/projects/cargo) (*)
│ ├── gix-index v0.37.0
│ │ ├── gix v0.69.1 (*)
│ │ ├── gix-dir v0.11.0
│ │ │ └── gix v0.69.1 (*)
│ │ └── gix-worktree v0.38.0
│ │ ├── gix v0.69.1 (*)
│ │ └── gix-dir v0.11.0 (*)
│ ├── gix-protocol v0.47.0
│ │ └── gix v0.69.1 (*)
│ ├── gix-ref v0.49.1
│ │ ├── gix v0.69.1 (*)
│ │ ├── gix-config v0.42.0
│ │ │ ├── gix v0.69.1 (*)
│ │ │ └── gix-submodule v0.16.0
│ │ │ └── gix v0.69.1 (*)
│ │ ├── gix-discover v0.37.0
│ │ │ ├── gix v0.69.1 (*)
│ │ │ └── gix-dir v0.11.0 (*)
│ │ └── gix-protocol v0.47.0 (*)
│ └── gix-shallow v0.1.0
│ ├── gix v0.69.1 (*)
│ └── gix-protocol v0.47.0 (*)
├── handlebars v6.2.0
│ └── mdman v0.0.0 (/projects/cargo/crates/mdman)
├── pest v2.7.9
│ ├── handlebars v6.2.0 (*)
│ ├── pest_derive v2.7.9 (proc-macro)
│ │ └── handlebars v6.2.0 (*)
│ ├── pest_generator v2.7.9
│ │ └── pest_derive v2.7.9 (proc-macro) (*)
│ └── pest_meta v2.7.9
│ └── pest_generator v2.7.9 (*)
├── varisat v0.2.2
│ └── resolver-tests v0.0.0 (/projects/cargo/crates/resolver-tests)
├── varisat-checker v0.2.2
│ └── varisat v0.2.2 (*)
└── varisat-dimacs v0.2.2
├── varisat v0.2.2 (*)
└── varisat-checker v0.2.2 (*)
```
After
```
$ cargo tree --workspace -i thiserror@1.0.63
thiserror v1.0.63
├── cargo_metadata v0.19.0
│ └── capture v0.1.0 (/projects/cargo/benches/capture)
├── handlebars v6.2.0
│ └── mdman v0.0.0 (/projects/cargo/crates/mdman)
├── pest v2.7.9
│ ├── handlebars v6.2.0 (*)
│ ├── pest_derive v2.7.9 (proc-macro)
│ │ └── handlebars v6.2.0 (*)
│ ├── pest_generator v2.7.9
│ │ └── pest_derive v2.7.9 (proc-macro) (*)
│ └── pest_meta v2.7.9
│ └── pest_generator v2.7.9 (*)
├── varisat v0.2.2
│ └── resolver-tests v0.0.0 (/projects/cargo/crates/resolver-tests)
├── varisat-checker v0.2.2
│ └── varisat v0.2.2 (*)
└── varisat-dimacs v0.2.2
├── varisat v0.2.2 (*)
└── varisat-checker v0.2.2 (*)
```
### How should we test and review this PR?
It has nothing changed but thiserror version.
https://diff.rs/gix-lock/15.0.0/gix-lock/15.0.1/Cargo.toml/
2025-01-03 20:06:26 +00:00
Weihang Lo
3e9b28a0d6
chore: bump gix-lock to remove thiserror@1 from cargo
...
Other dev tools for cargo development are fine keeping v1.
They are not shipped to end users.
Before
```
cargo tree --workspace -i thiserror@1.0.63
thiserror v1.0.63
├── cargo_metadata v0.19.0
│ └── capture v0.1.0 (/projects/cargo/benches/capture)
├── gix-lock v15.0.0
│ ├── gix v0.69.1
│ │ └── cargo v0.86.0 (/projects/cargo)
│ │ ├── benchsuite v0.0.0 (/projects/cargo/benches/benchsuite)
│ │ ├── resolver-tests v0.0.0 (/projects/cargo/crates/resolver-tests)
│ │ ├── xtask-bump-check v0.0.0 (/projects/cargo/crates/xtask-bump-check)
│ │ └── xtask-lint-docs v0.1.0 (/projects/cargo/crates/xtask-lint-docs)
│ │ [dev-dependencies]
│ │ └── cargo v0.86.0 (/projects/cargo) (*)
│ ├── gix-index v0.37.0
│ │ ├── gix v0.69.1 (*)
│ │ ├── gix-dir v0.11.0
│ │ │ └── gix v0.69.1 (*)
│ │ └── gix-worktree v0.38.0
│ │ ├── gix v0.69.1 (*)
│ │ └── gix-dir v0.11.0 (*)
│ ├── gix-protocol v0.47.0
│ │ └── gix v0.69.1 (*)
│ ├── gix-ref v0.49.1
│ │ ├── gix v0.69.1 (*)
│ │ ├── gix-config v0.42.0
│ │ │ ├── gix v0.69.1 (*)
│ │ │ └── gix-submodule v0.16.0
│ │ │ └── gix v0.69.1 (*)
│ │ ├── gix-discover v0.37.0
│ │ │ ├── gix v0.69.1 (*)
│ │ │ └── gix-dir v0.11.0 (*)
│ │ └── gix-protocol v0.47.0 (*)
│ └── gix-shallow v0.1.0
│ ├── gix v0.69.1 (*)
│ └── gix-protocol v0.47.0 (*)
├── handlebars v6.2.0
│ └── mdman v0.0.0 (/projects/cargo/crates/mdman)
├── pest v2.7.9
│ ├── handlebars v6.2.0 (*)
│ ├── pest_derive v2.7.9 (proc-macro)
│ │ └── handlebars v6.2.0 (*)
│ ├── pest_generator v2.7.9
│ │ └── pest_derive v2.7.9 (proc-macro) (*)
│ └── pest_meta v2.7.9
│ └── pest_generator v2.7.9 (*)
├── varisat v0.2.2
│ └── resolver-tests v0.0.0 (/projects/cargo/crates/resolver-tests)
├── varisat-checker v0.2.2
│ └── varisat v0.2.2 (*)
└── varisat-dimacs v0.2.2
├── varisat v0.2.2 (*)
└── varisat-checker v0.2.2 (*)
```
After
```
cargo tree --workspace -i thiserror@1.0.63
thiserror v1.0.63
├── cargo_metadata v0.19.0
│ └── capture v0.1.0 (/projects/cargo/benches/capture)
├── handlebars v6.2.0
│ └── mdman v0.0.0 (/projects/cargo/crates/mdman)
├── pest v2.7.9
│ ├── handlebars v6.2.0 (*)
│ ├── pest_derive v2.7.9 (proc-macro)
│ │ └── handlebars v6.2.0 (*)
│ ├── pest_generator v2.7.9
│ │ └── pest_derive v2.7.9 (proc-macro) (*)
│ └── pest_meta v2.7.9
│ └── pest_generator v2.7.9 (*)
├── varisat v0.2.2
│ └── resolver-tests v0.0.0 (/projects/cargo/crates/resolver-tests)
├── varisat-checker v0.2.2
│ └── varisat v0.2.2 (*)
└── varisat-dimacs v0.2.2
├── varisat v0.2.2 (*)
└── varisat-checker v0.2.2 (*)
```
2025-01-03 14:30:08 -05:00
Weihang Lo
2939e969f5
refactor(manifest): Clean up field -> env var handling ( #15008 )
...
### What does this PR try to resolve?
This is basically my PR feedback for #14973 .
### How should we test and review this PR?
### Additional information
2025-01-02 22:20:42 +00:00
Ed Page
0414bb5ac1
refactor(manifest): Keep struct/impl close for easier viewing
2025-01-02 15:06:17 -06:00
Ed Page
711d6bef36
refactor(manifest): Make env macro as minimal as possible
...
Macros add a lot of code complexity. This tries to reduce it by making
the macro do the bare minimum possible.
This does cause some extra branching (unless its compiled out) but that
shouldn't be prohibitive.
2025-01-02 15:03:11 -06:00
Ed Page
b16514de3b
refactor(manifest): Fully qualify manifest env vars
...
This simplifies the macro and makes the content searchable
2025-01-02 14:52:57 -06:00
Ed Page
f30f452e3c
chore(deps): update rust crate thiserror to v2 ( #14998 )
...
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [thiserror](https://redirect.github.com/dtolnay/thiserror ) |
workspace.dependencies | major | `1.0.63` -> `2.0.0` |
---
### Release Notes
<details>
<summary>dtolnay/thiserror (thiserror)</summary>
###
[`v2.0.9`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.9 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.8...2.0.9 )
- Work around `missing_inline_in_public_items` clippy restriction being
triggered in macro-generated code
([#​404](https://redirect.github.com/dtolnay/thiserror/issues/404 ))
###
[`v2.0.8`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.8 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.7...2.0.8 )
- Improve support for macro-generated `derive(Error)` call sites
([#​399](https://redirect.github.com/dtolnay/thiserror/issues/399 ))
###
[`v2.0.7`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.7 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.6...2.0.7 )
- Work around conflict with #\[deny(clippy::allow_attributes)]
([#​397](https://redirect.github.com/dtolnay/thiserror/issues/397 ),
thanks [@​zertosh](https://redirect.github.com/zertosh ))
###
[`v2.0.6`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.6 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.5...2.0.6 )
- Suppress deprecation warning on generated From impls
([#​396](https://redirect.github.com/dtolnay/thiserror/issues/396 ))
###
[`v2.0.5`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.5 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.4...2.0.5 )
- Prevent deprecation warning on generated impl for deprecated type
([#​394](https://redirect.github.com/dtolnay/thiserror/issues/394 ))
###
[`v2.0.4`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.4 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.3...2.0.4 )
- Eliminate needless_lifetimes clippy lint in generated `From` impls
([#​391](https://redirect.github.com/dtolnay/thiserror/issues/391 ),
thanks [@​matt-phylum](https://redirect.github.com/matt-phylum ))
###
[`v2.0.3`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.3 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.2...2.0.3 )
- Support the same Path field being repeated in both Debug and Display
representation in error message
([#​383](https://redirect.github.com/dtolnay/thiserror/issues/383 ))
- Improve error message when a format trait used in error message is not
implemented by some field
([#​384](https://redirect.github.com/dtolnay/thiserror/issues/384 ))
###
[`v2.0.2`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.2 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.1...2.0.2 )
- Fix hang on invalid input inside #\[error(...)] attribute
([#​382](https://redirect.github.com/dtolnay/thiserror/issues/382 ))
###
[`v2.0.1`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.1 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.0...2.0.1 )
- Support errors that contain a dynamically sized final field
([#​375](https://redirect.github.com/dtolnay/thiserror/issues/375 ))
- Improve inference of trait bounds for fields that are interpolated
multiple times in an error message
([#​377](https://redirect.github.com/dtolnay/thiserror/issues/377 ))
###
[`v2.0.0`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.0 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.69...2.0.0 )
#### Breaking changes
- Referencing keyword-named fields by a raw identifier like `{r#type}`
inside a format string is no longer accepted; simply use the unraw name
like `{type}`
([#​347](https://redirect.github.com/dtolnay/thiserror/issues/347 ))
This aligns thiserror with the standard library's formatting macros,
which gained support for implicit argument capture later than the
release of this feature in thiserror 1.x.
```rust
#[derive(Error, Debug)]
#[error("... {type} ...")] // Before: {r#type}
pub struct Error {
pub r#type: Type,
}
```
- Trait bounds are no longer inferred on fields whose value is shadowed
by an explicit named argument in a format message
([#​345](https://redirect.github.com/dtolnay/thiserror/issues/345 ))
```rust
// Before: impl<T: Octal> Display for Error<T>
// After: impl<T> Display for Error<T>
#[derive(Error, Debug)]
#[error("{thing:o}", thing = "...")]
pub struct Error<T> {
thing: T,
}
```
- Tuple structs and tuple variants can no longer use numerical `{0}`
`{1}` access at the same time as supplying extra positional arguments
for a format message, as this makes it ambiguous whether the number
refers to a tuple field vs a different positional arg
([#​354](https://redirect.github.com/dtolnay/thiserror/issues/354 ))
```rust
#[derive(Error, Debug)]
#[error("ambiguous: {0} {}", $N)]
// ^^^ Not allowed, use #[error("... {0} {n}", n = $N)]
pub struct TupleError(i32);
```
- Code containing invocations of thiserror's `derive(Error)` must now
have a direct dependency on the `thiserror` crate regardless of the
error data structure's contents
([#​368](https://redirect.github.com/dtolnay/thiserror/issues/368 ),
[#​369](https://redirect.github.com/dtolnay/thiserror/issues/369 ),
[#​370](https://redirect.github.com/dtolnay/thiserror/issues/370 ),
[#​372](https://redirect.github.com/dtolnay/thiserror/issues/372 ))
#### Features
- Support disabling thiserror's standard library dependency by disabling
the default "std" Cargo feature: `thiserror = { version = "2",
default-features = false }`
([#​373](https://redirect.github.com/dtolnay/thiserror/issues/373 ))
- Support using `r#source` as field name to opt out of a field named
"source" being treated as an error's `Error::source()`
([#​350](https://redirect.github.com/dtolnay/thiserror/issues/350 ))
```rust
#[derive(Error, Debug)]
#[error("{source} ==> {destination}")]
pub struct Error {
r#source: char,
destination: char,
}
let error = Error { source: 'S', destination: 'D' };
```
- Infinite recursion in a generated Display impl now produces an
`unconditional_recursion` warning
([#​359](https://redirect.github.com/dtolnay/thiserror/issues/359 ))
```rust
#[derive(Error, Debug)]
#[error("??? {self}")]
pub struct Error;
```
- A new attribute `#[error(fmt = path::to::myfmt)]` can be used to write
formatting logic for an enum variant out-of-line
([#​367](https://redirect.github.com/dtolnay/thiserror/issues/367 ))
```rust
#[derive(Error, Debug)]
pub enum Error {
#[error(fmt = demo_fmt)]
Demo { code: u16, message: Option<String> },
}
fn demo_fmt(code: &u16, message: &Option<String>, formatter: &mut
fmt::Formatter) -> fmt::Result {
write!(formatter, "{code}")?;
if let Some(msg) = message {
write!(formatter, " - {msg}")?;
}
Ok(())
}
```
- Enums with an enum-level format message are now able to have
individual variants that are `transparent` to supersede the enum-level
message
([#​366](https://redirect.github.com/dtolnay/thiserror/issues/366 ))
```rust
#[derive(Error, Debug)]
#[error("my error {0}")]
pub enum Error {
Json(#[from] serde_json::Error),
Yaml(#[from] serde_yaml::Error),
#[error(transparent)]
Other(#[from] anyhow::Error),
}
```
###
[`v1.0.69`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.69 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.68...1.0.69 )
- Backport
[2.0.2](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.2 )
fixes
###
[`v1.0.68`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.68 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.67...1.0.68 )
- Handle incomplete expressions more robustly in format arguments, such
as while code is being typed
([#​341](https://redirect.github.com/dtolnay/thiserror/issues/341 ),
[#​344](https://redirect.github.com/dtolnay/thiserror/issues/344 ))
###
[`v1.0.67`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.67 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.66...1.0.67 )
- Improve expression syntax support inside format arguments
([#​335](https://redirect.github.com/dtolnay/thiserror/issues/335 ),
[#​337](https://redirect.github.com/dtolnay/thiserror/issues/337 ),
[#​339](https://redirect.github.com/dtolnay/thiserror/issues/339 ),
[#​340](https://redirect.github.com/dtolnay/thiserror/issues/340 ))
###
[`v1.0.66`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.66 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.65...1.0.66 )
- Improve compile error on malformed format attribute
([#​327](https://redirect.github.com/dtolnay/thiserror/issues/327 ))
###
[`v1.0.65`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.65 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.64...1.0.65 )
- Ensure OUT_DIR is left with deterministic contents after build script
execution
([#​325](https://redirect.github.com/dtolnay/thiserror/issues/325 ))
###
[`v1.0.64`](https://redirect.github.com/dtolnay/thiserror/releases/tag/1.0.64 )
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/1.0.63...1.0.64 )
- Exclude derived impls from coverage instrumentation
([#​322](https://redirect.github.com/dtolnay/thiserror/issues/322 ),
thanks [@​oxalica](https://redirect.github.com/oxalica ))
</details>
---
### Configuration
📅 **Schedule**: Branch creation - "before 5am on the first day of the
month" (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:eyJjcmVhdGVkSW5WZXIiOiIzOS44NS4wIiwidXBkYXRlZEluVmVyIjoiMzkuODUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->
2025-01-02 19:58:01 +00:00
renovate[bot]
13af53a518
chore(deps): update rust crate thiserror to v2
2025-01-02 13:18:39 -06:00
Rustin170506
0c2bb4e5a8
test: add the dep case
...
Signed-off-by: Rustin170506 <techregister@pm.me>
2025-01-02 23:17:15 +08:00
Rustin170506
feda97d9f2
test: add the no lock file case
...
Signed-off-by: Rustin170506 <techregister@pm.me>
2025-01-02 23:17:15 +08:00
Rustin170506
5465e6a451
fix: remove unsupported embedded workspace check from cargo pkgid
command
...
Signed-off-by: Rustin170506 <techregister@pm.me>
2025-01-02 23:17:11 +08:00
Weihang Lo
fbca21b87b
test(git): Clean up shallow fetch tests ( #15002 )
...
### What does this PR try to resolve?
When looking to add shallow fetch for the git CLI, I found it hard to
tell what we test. This tries to clean up the tests and make it easier
to add new ones. My hope is to later generalize the test bodies so we
can more easily test any git backend in any combination of shallow or
deep fetches.
This is part of #13285 .
### How should we test and review this PR?
### Additional information
2025-01-02 04:15:36 +00:00
Ed Page
0200aa0d63
fix(schema): Correct and update the JSON Schema ( #15000 )
...
### What does this PR try to resolve?
Fixes #14999
### How should we test and review this PR?
### Additional information
2025-01-01 17:59:14 +00:00
Weihang Lo
f73259dbff
chore(deps): update rust crate itertools to 0.14.0 ( #14996 )
...
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [itertools](https://redirect.github.com/rust-itertools/itertools ) |
workspace.dependencies | minor | `0.13.0` -> `0.14.0` |
---
### Release Notes
<details>
<summary>rust-itertools/itertools (itertools)</summary>
###
[`v0.14.0`](https://redirect.github.com/rust-itertools/itertools/blob/HEAD/CHANGELOG.md#0140 )
[Compare
Source](https://redirect.github.com/rust-itertools/itertools/compare/v0.13.0...v0.14.0 )
##### Breaking
- Increased MSRV to 1.63.0
([#​960](https://redirect.github.com/rust-itertools/itertools/issues/960 ))
- Removed generic parameter from `cons_tuples`
([#​988](https://redirect.github.com/rust-itertools/itertools/issues/988 ))
##### Added
- Added `array_combinations`
([#​991](https://redirect.github.com/rust-itertools/itertools/issues/991 ))
- Added `k_smallest_relaxed` and variants
([#​925](https://redirect.github.com/rust-itertools/itertools/issues/925 ))
- Added `next_array` and `collect_array`
([#​560](https://redirect.github.com/rust-itertools/itertools/issues/560 ))
- Implemented `DoubleEndedIterator` for `FilterOk`
([#​948](https://redirect.github.com/rust-itertools/itertools/issues/948 ))
- Implemented `DoubleEndedIterator` for `FilterMapOk`
([#​950](https://redirect.github.com/rust-itertools/itertools/issues/950 ))
##### Changed
- Allow `Q: ?Sized` in `Itertools::contains`
([#​971](https://redirect.github.com/rust-itertools/itertools/issues/971 ))
- Improved hygiene of `chain!`
([#​943](https://redirect.github.com/rust-itertools/itertools/issues/943 ))
- Improved `into_group_map_by` documentation
([#​1000](https://redirect.github.com/rust-itertools/itertools/issues/1000 ))
- Improved `tree_reduce` documentation
([#​955](https://redirect.github.com/rust-itertools/itertools/issues/955 ))
- Improved discoverability of `merge_join_by`
([#​966](https://redirect.github.com/rust-itertools/itertools/issues/966 ))
- Improved discoverability of `take_while_inclusive`
([#​972](https://redirect.github.com/rust-itertools/itertools/issues/972 ))
- Improved documentation of `find_or_last` and `find_or_first`
([#​984](https://redirect.github.com/rust-itertools/itertools/issues/984 ))
- Prevented exponentially large type sizes in `tuple_combinations`
([#​945](https://redirect.github.com/rust-itertools/itertools/issues/945 ))
- Added `track_caller` attr for `asser_equal`
([#​976](https://redirect.github.com/rust-itertools/itertools/issues/976 ))
##### Notable Internal Changes
- Fixed clippy lints
([#​956](https://redirect.github.com/rust-itertools/itertools/issues/956 ),
[#​987](https://redirect.github.com/rust-itertools/itertools/issues/987 ),
[#​1008](https://redirect.github.com/rust-itertools/itertools/issues/1008 ))
- Addressed warnings within doctests
([#​964](https://redirect.github.com/rust-itertools/itertools/issues/964 ))
- CI: Run most tests with miri
([#​961](https://redirect.github.com/rust-itertools/itertools/issues/961 ))
- CI: Speed up "cargo-semver-checks" action
([#​938](https://redirect.github.com/rust-itertools/itertools/issues/938 ))
- Changed an instance of `default_features` in `Cargo.toml` to
`default-features`
([#​985](https://redirect.github.com/rust-itertools/itertools/issues/985 ))
</details>
---
### Configuration
📅 **Schedule**: Branch creation - "before 5am on the first day of the
month" (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:eyJjcmVhdGVkSW5WZXIiOiIzOS44NS4wIiwidXBkYXRlZEluVmVyIjoiMzkuODUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->
2025-01-01 16:34:23 +00:00
Ed Page
876f17d46b
chore(ci): Ensure JSON schema gets updated
2025-01-01 10:16:18 -06:00
Ed Page
729776b589
fix(schema): Correct and update the JSON Schema
...
Fixes #14999
2025-01-01 10:14:31 -06:00
Weihang Lo
03a5f111b1
fix: env table config can't trigger rebuild with rerun-if-env-changed
. ( #14756 )
...
### What does this PR try to resolve?
As #10358 said, `When a build.rs script emits
cargo:rerun-if-env-changed, it is not re-run when the value of the
specified variable is changed via the env configuration.`
Fixes #10358
### How should we test and review this PR?
Add test bofore fixing to reflect the issue, the next commit fixed it.
### Additional information
The PR is a sucessor of https://github.com/rust-lang/cargo/pull/14058 ,
so the previous dicussion can be refer to it.
2025-01-01 06:46:41 +00:00
Lin Yihai
76ffbe0571
fix: envs in config can trigger rebuild by custom build script with rerun-if-env-changed
.
2025-01-01 14:10:00 +08:00
Weihang Lo
3dabdcdd20
perf(cargo-package): match certain path prefix with pathspec
...
`check_repo_state` checks the entire git repo status.
This is usually fine if you have only a few packages in a workspace.
For huge monorepos, it may hit performance issues.
For example,
on awslabs/aws-sdk-rust@2cbd34d
the workspace has roughly 434 members to publish.
`git ls-files` reported us 204379 files in this Git repository.
That means git may need to check status of all files 434 times.
That would be `204379 * 434 = 88,700,486` checks!
Moreover, the current algorithm is finding the intersection of
`PathSource::list_files` and `git status`.
It is an `O(n^2)` check.
Let's assume files are evenly distributed into each package,
so roughly 470 files per package.
If we're unlucky to have some dirty files, say 100 files.
We will have to do `470 * 100 = 47,000` times of path comparisons.
Even worse, because we `git status` everything in the repo,
we'll have to it for all members,
even when those dirty files are not part of the current package in question.
So it becomes `470 * 100 * 434 = 20,398,000`!
Instead of comparing with the status of the entire repository,
this patch use the magic pathspec[1] to tell git only reports
paths that match a certain path prefix.
This wouldn't help the `O(n^2)` algorithm,
but at least it won't check dirty files outside the current package.
Also, we don't `git status` against entire git worktree/index anymore.
[1]: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec
2024-12-31 21:56:49 -05:00
Weihang Lo
61d587fbf4
chore(deps): update alpine docker tag to v3.21 ( #14995 )
...
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| alpine | final | minor | `3.20` -> `3.21` |
---
### Configuration
📅 **Schedule**: Branch creation - "before 5am on the first day of the
month" (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:eyJjcmVhdGVkSW5WZXIiOiIzOS44NS4wIiwidXBkYXRlZEluVmVyIjoiMzkuODUuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->
2025-01-01 02:56:30 +00:00