Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Incorrect number of "unsafe" instances reported #38

Open
sunfishcode opened this issue Aug 2, 2017 · 0 comments
Open

Incorrect number of "unsafe" instances reported #38

sunfishcode opened this issue Aug 2, 2017 · 0 comments

Comments

@sunfishcode
Copy link

Cargo-count incorrectly reports that the following code has no instances of "unsafe":

fn test() {
    unsafe { match doit() { } }
}
Gathering information...
         Language  Files  Lines  Blanks  Comments  Code  Unsafe (%)
         --------  -----  -----  ------  --------  ----  ----------
         Rust      1      3      0       0         3     
         --------  -----  -----  ------  --------  ----  ----------
Totals:            1      3      0       0         3     0 (0.00%)

For comparison, it correctly reports that this testcase has an instance of "unsafe" in it:

fn test() {
    match unsafe { doit() } { }
}
Gathering information...
         Language  Files  Lines  Blanks  Comments  Code  Unsafe (%)
         --------  -----  -----  ------  --------  ----  ----------
         Rust      1      3      0       0         3     1 (33.33%)
         --------  -----  -----  ------  --------  ----  ----------
Totals:            1      3      0       0         3     1 (33.33%)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant