-
Notifications
You must be signed in to change notification settings - Fork 290
Broken docs for std-detect on docs.rs #1799
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
Comments
The crates.io version of std-detect should never be used.
This is what we should fix instead. |
This indicates to me that the crates.io version can be used if you are working with for example x86_64-none-linux-gnu, that is you are on an OS (such as Linux) but not using libc (e.g. you are implementing your own libc in rust). I'm not sure if std-detect would work if you don't have an OS (e.g. bare metal when implementing a kernel or in embedded): that is why I was trying to look at the source of the macro in the first place, to figure out if it used cpuid directly or read data from the OS. If that isn't what the docs mean, I think the wording on https://docs.rs/crate/std_detect/latest should be updated to make that explicit.
Agreed, but both issues should be fixed. |
On most architectures std_detect is forced to use OS api's as the cpuid equivalent is not accessible from userspace. x86 is basically the only exception (though inside sgx enclaves cpuid isn't a thing there either) |
Then the "no-std on OS" use case remains (which is quite niche, and outside of Linux virtually non-existent unless you are the OS vendor). |
its because that's the url rustdoc is being passed via --extern-html-root-url |
https://docs.rs/crate/std_detect/latest reads:
"std_detect-0.1.5 doesn't have any documentation".
I suspect this is what breaks the source link from https://doc.rust-lang.org/stable/std/macro.is_x86_feature_detected.html
(Why that points to "latest" instead of the version std actually uses I have no idea, that seems quite unfortunate).
See also rust-lang/rust#141102 which is how I discovered this.
The text was updated successfully, but these errors were encountered: