Skip to content

Commit 30b7ca9

Browse files
authored
Merge branch 'main' into derives-library
2 parents 6a5371c + 5748ea2 commit 30b7ca9

10 files changed

Lines changed: 733 additions & 455 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ cargo make wdk-pre-commit-flow
8787
- **FFI naming:** Bindings in `wdk-sys` retain their original C names and style (e.g., PascalCase functions). Safe Rust wrappers in `wdk` follow [Rust naming conventions (RFC 430)](https://rust-lang.github.io/api-guidelines/naming.html).
8888
- **Formatting:** `rustfmt` uses nightly-only unstable options (see `rustfmt.toml`). Import grouping is `StdExternalCrate`, granularity is `Crate`.
8989
- **Lints:** Clippy `all` is deny, `pedantic`/`nursery`/`cargo` are warn. Most workspace members inherit `[lints] workspace = true`; `wdk-sys`, `wdk-build`, `wdk-macros`, and `cargo-wdk` define their own `[lints]` tables instead (Cargo currently does not support both inheriting workspace lints and selectively overriding them per crate).
90-
- **Edition:** 2024, MSRV 1.85.0, resolver v3.
90+
- **Edition:** 2024, MSRV 1.91.0, resolver v3.
9191
- **Static CRT:** Enabled globally via `.cargo/config.toml` (`-C target-feature=+crt-static`).
9292
- **Spelling:** `typos` is configured in `.typos.toml`; Windows API identifiers are allowlisted rather than using file-level excludes.
9393
- **TOML:** `taplo` uses CRLF line endings (see `taplo.toml`).

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ edition = "2024"
1919
license = "MIT OR Apache-2.0"
2020
readme = "README.md"
2121
repository = "https://github.com/microsoft/windows-drivers-rs"
22-
rust-version = "1.85.0"
22+
rust-version = "1.91.0"
2323

2424
[workspace.dependencies]
2525
# Workspace Crates

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ Minimal examples of `WDM`, `KMDF`, and `UMDF` drivers can be found in the [examp
178178

179179
## Cargo Make
180180

181+
> **Preview:** We are developing a new Cargo extension [`cargo-wdk`](https://crates.io/crates/cargo-wdk) that will replace `cargo-make` as the recommended tool for building Rust drivers. Please try it out and share your feedback.
182+
181183
[`cargo-make`](https://github.com/sagiegurari/cargo-make) is used to facilitate builds using `windows-drivers-rs`, including for executing post-build driver packaging steps.
182184

183185
To execute the default action (build and package driver):

crates/wdk-build/build.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ fn main() {
1414
// Custom attributes cannot be applied to expressions yet, so separate functions
1515
// are required for `rustversion` conditional compilation: https://github.com/rust-lang/rust/issues/15701
1616
// TODO: Remove the `setup_assert_matches_stabilized_cfg` feature and related
17-
// code once the minimum supported Rust version is 1.95.0 or later.
18-
#[rustversion::since(1.95.0)]
17+
// code once the minimum supported Rust version includes stable
18+
// `assert_matches`. Tracking issue:
19+
// https://github.com/rust-lang/rust/issues/82775
20+
#[rustversion::since(1.96.0)]
1921
fn setup_assert_matches_stabilized_cfg() {
2022
println!("cargo::rustc-cfg=assert_matches_stabilized");
2123
}
2224

23-
#[rustversion::before(1.95.0)]
25+
#[rustversion::before(1.96.0)]
2426
const fn setup_assert_matches_stabilized_cfg() {}

crates/wdk-build/src/bindgen.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,15 @@ impl BuilderExt for Builder {
162162
impl ParseCallbacks for WdkCallbacks {
163163
fn generated_name_override(&self, item_info: ItemInfo) -> Option<String> {
164164
// Override the generated name for the WDF function table symbol, since bindgen is unable to currently translate the #define automatically: https://github.com/rust-lang/rust-bindgen/issues/2544
165-
if let Some(wdf_function_table_symbol_name) = &self.wdf_function_table_symbol_name {
166-
if let ItemInfo {
165+
if let Some(wdf_function_table_symbol_name) = &self.wdf_function_table_symbol_name
166+
&& let ItemInfo {
167167
name: item_name,
168168
kind: ItemKind::Var,
169169
..
170170
} = item_info
171-
{
172-
if item_name == wdf_function_table_symbol_name {
173-
return Some("WdfFunctions".to_string());
174-
}
175-
}
171+
&& item_name == wdf_function_table_symbol_name
172+
{
173+
return Some("WdfFunctions".to_string());
176174
}
177175
None
178176
}

crates/wdk-build/src/cargo_make.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,14 @@ impl ParseCargoArgs for CompilationOptions {
337337
{
338338
"release" => {
339339
// cargo-make release profile sets the `--profile release` flag
340-
if let Some(profile) = &profile {
341-
if profile != "release" {
342-
eprintln!(
343-
"Specifying `--profile release` for cargo-make conflicts with the \
344-
setting `--profile {profile}` to forward to tasks"
345-
);
346-
std::process::exit(CLAP_USAGE_EXIT_CODE);
347-
}
340+
if let Some(profile) = &profile
341+
&& profile != "release"
342+
{
343+
eprintln!(
344+
"Specifying `--profile release` for cargo-make conflicts with the setting \
345+
`--profile {profile}` to forward to tasks"
346+
);
347+
std::process::exit(CLAP_USAGE_EXIT_CODE);
348348
}
349349

350350
append_to_space_delimited_env_var(

crates/wdk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ readme.workspace = true
1717
repository.workspace = true
1818

1919
[features]
20+
# Deprecated: no longer required. Kept as a no-op for backward compatibility.
2021
alloc = []
21-
default = ["alloc"]
2222
nightly = ["wdk-sys/nightly"]
2323

2424
[dependencies]

0 commit comments

Comments
 (0)