target_feature leads to confusing note in rustdoc #131735
Labels
A-rustdoc-ui
Area: Rustdoc UI (generated HTML)
C-bug
Category: This is a bug.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
T-rustdoc-frontend
Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
I tried this code:
I expected to see this happen:
Rustdoc says something along the lines of:
Instead, this happened:
Rustdoc says:
It is not clear what “available” means here. I initially thought it meant the function would not be defined if not compiled with
--codegen target-feature=+avx2
(and concluded it was always safe to call if the calling program compiles). Instead it means the function is always defined but must not be called if the target feature is not available at runtime. Rustdoc gives no other indication that thetarget_feature
attribute is used, and the note looks a lot like the “available on create feature … only” notes.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: