Skip to content

Commit 339e38e

Browse files
authored
cargo update & lint/clippy/rustfmt/cargo-deny fixes. (#3)
This fixes the remaining CI failures. The `rustfmt.toml` change was prompted by @Firestar99's formatting changes in #2, and the subsequent local rebasing, with `version = "Two"` causing warnings due to: - rust-lang/rustfmt#6247 So the perma-unstable `rustfmt.toml` `version` config is now `style_edition = "2024"`, and hopefully that gets stabilized at the same time as Rust 2024 becoming stable.
2 parents 39140c7 + c465e02 commit 339e38e

File tree

6 files changed

+25
-33
lines changed

6 files changed

+25
-33
lines changed

.github/workflows/ci.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ jobs:
1818
submodules: true
1919
- uses: actions-rs/toolchain@v1
2020
with:
21-
# HACK(eddyb) only nightly supports setting `version = "Two"`
22-
# in `rustfmt.toml`, which is needed to format array/slice patterns
23-
# at all (see https://github.com/rust-lang/rustfmt/pull/4994).
21+
# FIXME(eddyb) `style_edition = "2024"` in `rustfmt.toml` is what keeps
22+
# this on `nightly`, should switch to `stable` when that stabilizes.
2423
toolchain: nightly
25-
override: true
24+
# HACK(eddyb) use `nightly` by default without breaking the ability to
25+
# temporarily bypass it through `rust-toolchain.toml`.
26+
default: true
27+
override: false
2628

2729
# run cargo fetch w/ --locked to verify Cargo.lock is up-to-date
2830
- run: cargo fetch --locked
@@ -91,7 +93,7 @@ jobs:
9193
- uses: actions/checkout@v3
9294
with:
9395
submodules: true
94-
- uses: EmbarkStudios/cargo-deny-action@v1
96+
- uses: EmbarkStudios/cargo-deny-action@v2
9597

9698
publish-check:
9799
name: Publish Check

Cargo.lock

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ serde = { version = "1.0", features = ["derive"] }
3434
serde_json = "1.0"
3535
smallvec = { version = "1.7.0", features = ["serde", "union"] }
3636

37+
[lints.rust]
38+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(git_main_docs)'] }
39+
3740
[package.metadata.docs.rs]
3841
all-features = true
3942
rustdoc-args = ["--cfg", "docsrs", "--document-private-items"]

deny.toml

+4-17
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,17 @@
22
# More documentation for the advisories section can be found here:
33
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html
44
[advisories]
5-
# The lint level for security vulnerabilities
6-
vulnerability = "deny"
7-
# The lint level for unmaintained crates
8-
unmaintained = "deny"
5+
# NOTE(eddyb) see https://github.com/EmbarkStudios/cargo-deny/pull/611.
6+
version = 2
97
# The lint level for crates that have been yanked from their source registry
108
yanked = "deny"
11-
# The lint level for crates with security notices. Note that as of
12-
# 2019-12-17 there are no security notice advisories in
13-
# https://github.com/rustsec/advisory-db
14-
notice = "deny"
159

1610
# This section is considered when running `cargo deny check licenses`
1711
# More documentation for the licenses section can be found here:
1812
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
1913
[licenses]
20-
# The lint level for crates which do not have a detectable license
21-
unlicensed = "deny"
14+
# NOTE(eddyb) see https://github.com/EmbarkStudios/cargo-deny/pull/611.
15+
version = 2
2216
# List of explicitly allowed licenses
2317
# See https://spdx.org/licenses/ for list of possible licenses
2418
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
@@ -27,8 +21,6 @@ allow = [
2721
"Apache-2.0",
2822
"Unicode-DFS-2016",
2923
]
30-
# Lint level for licenses considered copyleft
31-
copyleft = "deny"
3224

3325
# This section is considered when running `cargo deny check bans`.
3426
# More documentation about the 'bans' section can be found here:
@@ -38,11 +30,6 @@ copyleft = "deny"
3830
multiple-versions = "deny"
3931
# Lint level for when a crate version requirement is `*`
4032
wildcards = "deny"
41-
# Certain crates/versions that will be skipped when doing duplicate detection.
42-
skip = [
43-
# FIXME(eddyb) `syn 2` has not replaced `syn 1` across the ecosystem yet.
44-
{ name = "syn", version = "2" },
45-
]
4633

4734
# This section is considered when running `cargo deny check sources`.
4835
# More documentation about the 'sources' section can be found here:

rustfmt.toml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# HACK(eddyb) needed to format array/slice patterns at all, because it was a
2-
# breaking change (see https://github.com/rust-lang/rustfmt/pull/4994).
3-
version = "Two"
1+
style_edition = "2024"
42

53
# HACK(eddyb) avoid random spilling of e.g. method call chains onto many lines.
64
use_small_heuristics = "Max"

src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104
clippy::match_wild_err_arm,
105105
clippy::match_wildcard_for_single_variants,
106106
clippy::mem_forget,
107-
clippy::mismatched_target_os,
108107
clippy::missing_enforced_import_renames,
109108
clippy::mut_mut,
110109
clippy::mutex_integer,
@@ -145,6 +144,9 @@
145144
// NOTE(eddyb) ignored because it's misguided to suggest `let mut s = ...;`
146145
// and `s.push_str(...);` when `+` is equivalent and does not require `let`.
147146
clippy::string_add,
147+
148+
// FIXME(eddyb) rework doc comments to conform to linted expectations.
149+
clippy::too_long_first_doc_paragraph,
148150
)]
149151
// NOTE(eddyb) this is stronger than the "Embark standard lints" above, because
150152
// we almost never need `unsafe` code and this is a further "speed bump" to it.

0 commit comments

Comments
 (0)