Skip to content

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

Open
@thomcc

Description

@thomcc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions