Skip to content
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

Lint against #[cfg(linux)] → #[cfg(unix)] #3949

Closed
oberien opened this issue Apr 13, 2019 · 2 comments · Fixed by #5506
Closed

Lint against #[cfg(linux)] → #[cfg(unix)] #3949

oberien opened this issue Apr 13, 2019 · 2 comments · Fixed by #5506
Labels
A-lint Area: New lints L-correctness Lint: Belongs in the correctness lint group

Comments

@oberien
Copy link

oberien commented Apr 13, 2019

There have been several instances where I wrote #[cfg(linux)] to feature-gate something to linux. This is wrong and will never be evaluated to true. Instead #[cfg(unix)] must be used.

@flip1995 flip1995 added L-correctness Lint: Belongs in the correctness lint group A-lint Area: New lints labels Apr 13, 2019
@JamesHinshelwood
Copy link
Contributor

Another possibility could be that #[cfg(target_os="linux")] was intended. I guess we could suggest both?

@euclio
Copy link
Contributor

euclio commented Jan 17, 2020

I also think it would be useful to lint #[cfg(macos)] -> #[cfg(target_os="macos")].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints L-correctness Lint: Belongs in the correctness lint group
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants