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

Feature soundness is a chore to deal with #2641

Open
1 of 3 tasks
WorldSEnder opened this issue Apr 26, 2022 · 3 comments
Open
1 of 3 tasks

Feature soundness is a chore to deal with #2641

WorldSEnder opened this issue Apr 26, 2022 · 3 comments
Labels
A-ci Area: The continuous integration ergonomics

Comments

@WorldSEnder
Copy link
Member

WorldSEnder commented Apr 26, 2022

Problem
The feature soundness lints are useful but clippy is not very helpful when determining the correct visibilities and features. At least sometimes I don't understand immediately why clippy is allowing some things but not others. Take for example this clippy run. It complains about a function that is apparently never used, but it is used, just in a module that happens to have a cfg(any(feature = "csr", feature = "ssr")) annotation somewhere further up in the module hierarchy. It's a pain to figure that out, since the tooling doesn't help much in reasoning why the function is unused.

Expected behavior
A clear module tree and feature dependencies. When searching cfg(feature, I get 168 results across the code base. That's too many to reasonably figure out which impact what part.

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later
@WorldSEnder WorldSEnder added bug ergonomics A-ci Area: The continuous integration and removed bug labels Apr 26, 2022
@ranile
Copy link
Member

ranile commented Apr 26, 2022

cargo hack may be helpful here

@futursolo
Copy link
Member

This is unfortunate, but not that clippy is wrong in any way.

When clippy runs with a certain feature flag, it treats all code that is flagged as inactive as if they are not there.
This is needed because compiler flag can be used to feature gate conflicting code.

This simply means that anything that is only used by code marked with a certain compiler flag should also be marked with the same flag.

@pseacrest
Copy link

Cargo hack can definitely be recommended but otherwise I agree with OP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ci Area: The continuous integration ergonomics
Projects
None yet
Development

No branches or pull requests

4 participants