cargo-c icon indicating copy to clipboard operation
cargo-c copied to clipboard

cbuild warns about #[cfg(test)]

Open cryptomilk opened this issue 9 months ago • 1 comments

If I run cargo cbuild I get:

warning: unexpected `cfg` condition name: `test`                       
   --> src/group_record.rs:236:7
    |                                                                                        
236 | #[cfg(test)]
    |       ^^^^
    |

How can I get rid of that warning with cbuild? I have a library and unit tests are implemented in the rust files itself.

cryptomilk avatar Mar 21 '25 11:03 cryptomilk

A current workaround seems to be adding the following to Cargo.toml:

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(test)'] }

cryptomilk avatar Mar 21 '25 11:03 cryptomilk