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

std_detect::detect::features() is not available #1385

Open
ronnychevalier opened this issue Feb 26, 2023 · 3 comments
Open

std_detect::detect::features() is not available #1385

ronnychevalier opened this issue Feb 26, 2023 · 3 comments

Comments

@ronnychevalier
Copy link

While std_detect::detect::features() is declared as pub, it is not exposed in std and the latest version of std_detect available on crates.io (0.1.5, 4 years ago) does not contain this function.
To access this function, one must depend on the git repository.

Would it be possible to release a new version of std_detect on crates.io? or expose std_detect::detect::features() in std like other functions of this crate?

@thomcc
Copy link
Member

thomcc commented Feb 26, 2023

I don't think we want to expose this, and it's not clear that releasing std_detect on crates.io is the right call either these days...

What's the use case you need it for? Avoiding multiple calls to std::is_*_feature_detected?

@ronnychevalier
Copy link
Author

I have a cargo subcommand that builds multiple versions of the same binary, each with a different CPU features set, merged into a single binary. At runtime it runs the optimized version based on the list of CPU features supported by the host.
I rely on std_detect::detect::features() to know the CPU features supported at runtime.

@Amanieu
Copy link
Member

Amanieu commented Feb 27, 2023

The proper interface to use is the is_*_features_detected macros. Anything else is an internal implementation detail and not supported.

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

3 participants