github / github/codeql

[Rust] Unused variable False positive

Open
#20,256 2 comments 0 reactions 0 assignees View on GitHub
false-positive
Dominant language
CodeQL
Stars
10.1k
Forks
2.1k
Avg merge
2d 15h
Merged PRs (30d)
141

Description

**Description of the false positive**

The argument is being used in the body of the function but flagged unused.

**Code samples or links to source code**

This is one specific example https://github.com/microsoft/windows-drivers-rs/blob/main/crates/cargo-wdk/src/providers/fs.rs#L29

**URL to the alert on GitHub code scanning (optional)**
https://github.com/microsoft/windows-drivers-rs/security/code-scanning/5

However, false positives for the arguments are generated for all the methods in [this](https://github.com/microsoft/windows-drivers-rs/blob/main/crates/cargo-wdk/src/providers/fs.rs) module and other sibling modules ([exec](https://github.com/microsoft/windows-drivers-rs/blob/main/crates/cargo-wdk/src/providers/exec.rs), [metadata](https://github.com/microsoft/windows-drivers-rs/blob/main/crates/cargo-wdk/src/providers/metadata.rs) and [wdk_build](https://github.com/microsoft/windows-drivers-rs/blob/main/crates/cargo-wdk/src/providers/wdk_build.rs)).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.