It eliminates the following output of `cargo autoinherit` command:
`multipart` won't be auto-inherited because there are multiple sources for it:
- version: ^0
- version: ~0.18
Changes:
- Allow "multipart" crate to use workspace dependencies by resolving
version differences constraints in Cargo.toml files.
This simplifies dependencies management and upgrades while ensuring that
dependencies version aligned with all the crates in the project and
neither dependency is used twice with different versions by accident
(though dependencies still can appear several times as sub-dependencies due to
misaligned version constraints for dependency resolution).
Documentation and useful articles:
- https://mainmatter.com/blog/2024/03/18/cargo-autoinherit/
- https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#inheriting-a-dependency-from-a-workspace
- https://crates.io/crates/cargo-autoinherit
Commands:
`cargo autoinherit`
Output:
$ cargo autoinherit
`multipart` won't be auto-inherited because there are multiple sources for it:
- version: ^0.18.0
- version: ^0
`sequoia-openpgp` won't be auto-inherited because there are multiple sources for it:
- version: ^1.17.0
- version: =1.17.0
Changes:
- Collect all the dependencies for workspace's crates in the top level
Cargo.toml file by applying `cargo autoinherit`.
- Use workspace dependencies in crates Cargo.toml files (i.e.
crate_name = { workspace = true }).
`cargo build` gives the following warnings:
warning: the following packages contain code that will be rejected by a future version of Rust: buf_redux v0.8.4, multipart v0.18.0, traitobject v0.1.0, typemap v0.3.3
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 1`
which is when run with `cargo build --future-incompat-report` gives the
following:
warning: `hagrid` (bin "hagrid") generated 9 warnings
Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.91s
warning: the following packages contain code that will be rejected by a future version of Rust: buf_redux v0.8.4, multipart v0.18.0, traitobject v0.1.0, typemap v0.3.3
note:
To solve this problem, you can try the following approaches:
- Some affected dependencies have newer versions available.
You may want to consider updating them to a newer version to see if the issue has been fixed.
traitobject v0.1.0 has the following newer versions available: 0.1.1
- If the issue is not solved by updating the dependencies, a fix has to be
implemented by those dependencies. You can help with that by notifying the
maintainers of this problem (e.g. by creating a bug report) or by proposing a
fix to the maintainers (e.g. by creating a pull request):
- buf_redux@0.8.4
- Repository: https://github.com/abonander/buf_redux
- Detailed warning command: `cargo report future-incompatibilities --id 3 --package buf_redux@0.8.4`
- multipart@0.18.0
- Repository: http://github.com/abonander/multipart
- Detailed warning command: `cargo report future-incompatibilities --id 3 --package multipart@0.18.0`
- traitobject@0.1.0
- Repository: https://github.com/reem/rust-traitobject.git
- Detailed warning command: `cargo report future-incompatibilities --id 3 --package traitobject@0.1.0`
- typemap@0.3.3
- Repository: https://github.com/reem/rust-typemap
- Detailed warning command: `cargo report future-incompatibilities --id 3 --package typemap@0.3.3`
- If waiting for an upstream fix is not an option, you can use the `[patch]`
section in `Cargo.toml` to use your own version of the dependency. For more
information, see:
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
note: this report can be shown with `cargo report future-incompatibilities --id 1`
In attempt to fix the warning I set explict dependency for "multipart"
crate.
Changes:
- Set explicit version of "multipart" dependency in Cargo.toml: "0" -> "0.18.0".
- Update Cargo.lock: `cargo build`
Fix the following and alike errors after switch to 2024 edition:
error: binding modifiers may only be written when the default binding mode is `move`
--> database/src/fs.rs:552:27
|
552 | ByFingerprint(ref fp) => self.link_by_fingerprint(fp),
| ^^^ binding modifier not allowed under `ref` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> database/src/fs.rs:552:13
|
552 | ByFingerprint(ref fp) => self.link_by_fingerprint(fp),
| ^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
help: remove the unnecessary binding modifier
|
552 - ByFingerprint(ref fp) => self.link_by_fingerprint(fp),
552 + ByFingerprint(fp) => self.link_by_fingerprint(fp),
|
error: binding modifiers may only be written when the default binding mode is `move`
--> database/src/fs.rs:553:21
|
553 | ByKeyID(ref keyid) => self.link_by_keyid(keyid),
| ^^^ binding modifier not allowed under `ref` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> database/src/fs.rs:553:13
|
553 | ByKeyID(ref keyid) => self.link_by_keyid(keyid),
| ^^^^^^^^^^^^^^^^^^ this matches on type `&_`
help: remove the unnecessary binding modifier
|
553 - ByKeyID(ref keyid) => self.link_by_keyid(keyid),
553 + ByKeyID(keyid) => self.link_by_keyid(keyid),
|
error: binding modifiers may only be written when the default binding mode is `move`
--> database/src/fs.rs:554:21
|
554 | ByEmail(ref email) => self.link_by_email(email),
| ^^^ binding modifier not allowed under `ref` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> database/src/fs.rs:554:13
|
554 | ByEmail(ref email) => self.link_by_email(email),
| ^^^^^^^^^^^^^^^^^^ this matches on type `&_`
help: remove the unnecessary binding modifier
|
554 - ByEmail(ref email) => self.link_by_email(email),
554 + ByEmail(email) => self.link_by_email(email),
|
error: binding modifiers may only be written when the default binding mode is `move`
--> database/src/sqlite.rs:278:27
|
278 | ByFingerprint(ref fp) => query_simple(
| ^^^ binding modifier not allowed under `ref` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> database/src/sqlite.rs:278:13
|
278 | ByFingerprint(ref fp) => query_simple(
| ^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
help: remove the unnecessary binding modifier
|
278 - ByFingerprint(ref fp) => query_simple(
278 + ByFingerprint(fp) => query_simple(
|
error: binding modifiers may only be written when the default binding mode is `move`
--> database/src/sqlite.rs:283:21
|
283 | ByKeyID(ref keyid) => query_simple(
| ^^^ binding modifier not allowed under `ref` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> database/src/sqlite.rs:283:13
|
283 | ByKeyID(ref keyid) => query_simple(
| ^^^^^^^^^^^^^^^^^^ this matches on type `&_`
help: remove the unnecessary binding modifier
|
283 - ByKeyID(ref keyid) => query_simple(
283 + ByKeyID(keyid) => query_simple(
|
error: binding modifiers may only be written when the default binding mode is `move`
--> database/src/sqlite.rs:288:21
|
288 | ByEmail(ref email) => query_simple(
| ^^^ binding modifier not allowed under `ref` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> database/src/sqlite.rs:288:13
|
288 | ByEmail(ref email) => query_simple(
| ^^^^^^^^^^^^^^^^^^ this matches on type `&_`
help: remove the unnecessary binding modifier
|
288 - ByEmail(ref email) => query_simple(
288 + ByEmail(email) => query_simple(
|
error: binding modifiers may only be written when the default binding mode is `move`
--> database/src/lib.rs:194:27
|
194 | ByFingerprint(ref fp) => self.by_fpr(fp),
| ^^^ binding modifier not allowed under `ref` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> database/src/lib.rs:194:13
|
194 | ByFingerprint(ref fp) => self.by_fpr(fp),
| ^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
help: remove the unnecessary binding modifier
|
194 - ByFingerprint(ref fp) => self.by_fpr(fp),
194 + ByFingerprint(fp) => self.by_fpr(fp),
|
error: binding modifiers may only be written when the default binding mode is `move`
--> database/src/lib.rs:195:21
|
195 | ByKeyID(ref keyid) => self.by_kid(keyid),
| ^^^ binding modifier not allowed under `ref` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> database/src/lib.rs:195:13
|
195 | ByKeyID(ref keyid) => self.by_kid(keyid),
| ^^^^^^^^^^^^^^^^^^ this matches on type `&_`
help: remove the unnecessary binding modifier
|
195 - ByKeyID(ref keyid) => self.by_kid(keyid),
195 + ByKeyID(keyid) => self.by_kid(keyid),
|
error: binding modifiers may only be written when the default binding mode is `move`
--> database/src/lib.rs:196:21
|
196 | ByEmail(ref email) => self.by_email(email),
| ^^^ binding modifier not allowed under `ref` default binding mode
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
--> database/src/lib.rs:196:13
|
196 | ByEmail(ref email) => self.by_email(email),
| ^^^^^^^^^^^^^^^^^^ this matches on type `&_`
help: remove the unnecessary binding modifier
|
196 - ByEmail(ref email) => self.by_email(email),
196 + ByEmail(email) => self.by_email(email),
|
Changes:
- Remove unnecessary "ref" binding modifiers in match statements as in
later Rust editions so called match ergonomics modified binding
behavior and "ref" when matching reference is not needed any more.
Changes:
- Change edition in the following Cargo.toml files to 2024:
- Cargo.toml change edition: 2018 -> 2024
- Explicitly set 2024 (i.e. default 2015 -> 2024) edition
in the following files:
- database/Cargo.toml
- hagridctl/Cargo.toml
- tester/Cargo.toml
NOTE: setting explicitly edition also clean up WARNINGS like ones bellow:
warning: .../hagrid/database/Cargo.toml: no edition set: defaulting to the 2015 edition while the latest is 2024
warning: .../hagrid/tester/Cargo.toml: no edition set: defaulting to the 2015 edition while the latest is 2024
warning: .../hagrid/hagridctl/Cargo.toml: no edition set: defaulting to the 2015 edition while the latest is 2024
Starting with 1.18.0, the retain_userids method starts working
differently, returning an empty cert if no signed user ids or direct key
signature is left. Since we need this, we'll stay on 1.17.0 for now.
Newer versions of ring are very obscure, and I couldn't figure out how
to use its interface in a reasonable time. I used the rust-crypto
methods instead where things were straightforward.