8000 cbuild warns about #[cfg(test)] · Issue #451 · lu-zero/cargo-c · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cbuild warns about #[cfg(test)] #451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cryptomilk opened this issue Mar 21, 2025 · 1 comment
Open

cbuild warns about #[cfg(test)] #451

cryptomilk opened this issue Mar 21, 2025 · 1 comment

Comments

@cryptomilk
Copy link

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
Copy link
Author

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

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

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

No branches or pull requests

1 participant
0