Skip to content

Commit ad08ee4

Browse files
committed
chore: rework workspace params, MSRV 1.64
* Move common workspace settings to the `[workspace]` sections in the root. * Remove Cargo settings that are identical to the defaults (per Cargo [recommendations](https://doc.rust-lang.org/cargo/reference/manifest.html)) * Add common clippy lint configuration * These require MSRV 1.64 `workspace-inheritance` feature * Fix perl-based method to extract MSRV
1 parent f199d07 commit ad08ee4

File tree

7 files changed

+54
-18
lines changed

7 files changed

+54
-18
lines changed

.github/workflows/ci.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
name: Verify build
3535
strategy:
3636
matrix:
37-
toolchain: [stable, nightly, 1.63.0]
37+
toolchain: [stable, nightly, 1.64.0]
3838
os: [ubuntu-24.04, macos-14, windows-2022]
3939
include:
4040
- toolchain: beta
@@ -49,7 +49,7 @@ jobs:
4949
- name: Update RUSTFLAGS
5050
run: |
5151
set -eux
52-
[ "${{ matrix.toolchain }}" = "1.63.0" ] && echo 'RUSTFLAGS=' >> "$GITHUB_ENV" || true
52+
[ "${{ matrix.toolchain }}" = "1.64.0" ] && echo 'RUSTFLAGS=' >> "$GITHUB_ENV" || true
5353
5454
- name: Setup Rust toolchain
5555
run: ./ci/install-rust.sh

Cargo.toml

+32-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ categories = ["external-ffi-bindings", "no-std", "os"]
66
exclude = ["/ci/*", "/.github/*", "/.cirrus.yml", "/triagebot.toml"]
77
description = "Raw FFI bindings to platform libraries like libc."
88
publish = false # On the main branch, we don't want to publish anything
9-
authors = ["The Rust Project Developers"]
10-
edition = "2021"
11-
license = "MIT OR Apache-2.0"
12-
repository = "https://github.com/rust-lang/libc"
13-
rust-version = "1.63"
9+
authors.workspace = true
10+
edition.workspace = true
11+
license.workspace = true
12+
repository.workspace = true
13+
rust-version.workspace = true
1414

1515
[package.metadata.docs.rs]
1616
features = ["extra_traits"]
@@ -136,9 +136,36 @@ std = []
136136
rustc-dep-of-std = ["rustc-std-workspace-core"]
137137
extra_traits = []
138138

139+
[lints]
140+
workspace = true
141+
139142
[workspace]
140143
members = [
141144
"ctest",
142145
"ctest-test",
143146
"libc-test",
144147
]
148+
149+
[workspace.package]
150+
authors = ["The Rust Project Developers"]
151+
license = "MIT OR Apache-2.0"
152+
edition = "2021"
153+
repository = "https://github.com/rust-lang/libc"
154+
rust-version = "1.64"
155+
156+
[workspace.lints.rust]
157+
# TODO: make idents consistent in each file
158+
# unused_qualifications = "warn"
159+
160+
[workspace.lints.clippy]
161+
# TODO: all these are default lints and should probably be fixed
162+
identity_op = "allow"
163+
if_same_then_else = "allow"
164+
missing_safety_doc = "allow"
165+
non_minimal_cfg = "allow"
166+
precedence = "allow"
167+
redundant_field_names = "allow"
168+
redundant_static_lifetimes = "allow"
169+
unnecessary_cast = "allow"
170+
unused_unit = "allow"
171+
zero_ptr = "allow"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ libc = "0.2"
5151

5252
## Rust version support
5353

54-
The minimum supported Rust toolchain version is currently **Rust 1.63**.
54+
The minimum supported Rust toolchain version is currently **Rust 1.64**.
5555

5656
Increases to the MSRV are allowed to change without a major (i.e. semver-
5757
breaking) release in order to avoid a ripple effect in the ecosystem. A policy

ctest-test/Cargo.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ name = "ctest-test"
33
version = "0.1.0"
44
authors = ["Alex Crichton <[email protected]>"]
55
publish = false
6-
edition = "2021"
6+
edition.workspace = true
7+
8+
[lints]
9+
workspace = true
710

811
[build-dependencies]
912
ctest = { path = "../ctest" }

ctest/Cargo.toml

+7-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ name = "ctest"
33
version = "0.4.11"
44
description = "Automated tests of FFI bindings."
55
exclude = ["CHANGELOG.md"]
6-
edition = "2021"
7-
license = "MIT OR Apache-2.0"
8-
repository = "https://github.com/rust-lang/libc"
9-
rust-version = "1.63.0"
6+
edition.workspace = true
7+
license.workspace = true
8+
repository.workspace = true
9+
rust-version.workspace = true
10+
11+
[lints]
12+
workspace = true
1013

1114
[dependencies]
1215
garando_syntax = "0.1"

ctest/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ APIs in Rust match the APIs defined in C.
1010

1111
## MSRV (Minimum Supported Rust Version)
1212

13-
The MSRV is 1.63.0 because of the transitive dependencies.
13+
The MSRV is 1.64.0 because of the transitive dependencies.
1414
Note that MSRV may be changed anytime by dependencies.
1515

1616
## Example

libc-test/Cargo.toml

+7-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ name = "libc-test"
33
version = "0.1.0"
44
description = "A test crate for the libc crate."
55
publish = false
6-
authors = ["The Rust Project Developers"]
7-
edition = "2021"
8-
license = "MIT OR Apache-2.0"
9-
repository = "https://github.com/rust-lang/libc"
6+
authors.workspace = true
7+
edition.workspace = true
8+
license.workspace = true
9+
repository.workspace = true
10+
11+
[lints]
12+
workspace = true
1013

1114
[dependencies]
1215
cfg-if = "1.0.0"

0 commit comments

Comments
 (0)