KEMBAR78
Use `--no-allow` for internal bindings to improve static analysis coverage by kennykerr · Pull Request #3686 · microsoft/windows-rs · GitHub
Skip to content

Conversation

@kennykerr
Copy link
Collaborator

The windows-bindgen crate will by default generate a blanket allow attribute as follows:

#![allow(
    non_snake_case,
    non_upper_case_globals,
    non_camel_case_types,
    dead_code,
    clippy::all
)]

This is convenient as it covers the most common scenarios where Windows APIs violate Rust conventions. It can however mask potential problems that I would prefer to handle directly (and early) where practical for internal uses. So for the internal bindings (dogfood) I have opted to use the --no-allow option.

I have also removed many of the wrapping main functions in the crate documentation to avoid the warning from the Clippy needless_doctest_main lint.

@kennykerr kennykerr merged commit d5d8306 into master Jul 29, 2025
29 checks passed
@kennykerr kennykerr deleted the allow-bindings branch July 29, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant