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 has cfg(feature = "use_std") but no such feature exists. #909

Open
thomcc opened this issue Sep 14, 2020 · 3 comments
Open

std_detect has cfg(feature = "use_std") but no such feature exists. #909

thomcc opened this issue Sep 14, 2020 · 3 comments

Comments

@thomcc
Copy link
Member

thomcc commented Sep 14, 2020

In std_detect::detect, the non-x86{,_64} code for linux / freebsd is behind feature = "use_std":

} else if #[cfg(all(target_os = "linux", feature = "use_std"))] {
#[path = "os/linux/mod.rs"]
mod os;
} else if #[cfg(all(target_os = "freebsd", feature = "use_std"))] {

I believe this is intended to be feature = "std_detect_file_io"? Or maybe not, because the linux module further cordons off the cpuinfo reading under that, implying it expects that it may exist without this std_detect_file_io:

#[cfg(feature = "std_detect_file_io")]
mod cpuinfo;

AFAICT this code is just totally dead, and it's a bit of a large amount of dead code to have sitting in the tree... and I can't find an old commit that even had a use_std feature, so I'm probably just wrong and am unaware of some mode that this code is compiled in — I know about "as a module of libstd", but is there anything else I should be aware of?

If not, even if the code is not production ready, it seems like it should stay compiling.

Anyway, I was gonna submit a PR with this to see if the CI passed at least, but I became worried that if it landed, it would regress #850, which added one of these lines, so I figured I'd ask first.

@Lokathor
Copy link
Contributor

It's possible that this gets set by somewhere else that builds this crate as a submodule.

@bjorn3
Copy link
Member

bjorn3 commented Sep 14, 2020

libstd doesn't enable it

@bjorn3
Copy link
Member

bjorn3 commented Sep 14, 2020

It was introduced in 4c66d96, but even rust-lang/rust#58373, which is the first stdarch update since that commit doesn't enable it.

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