-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
codegen/doc: Omit "Feature: vXXX
" text in favour of doc_cfg
#1086
Conversation
Nowadays we have the `doc_cfg` feature rendering clean, consistent and obvious markers for feature requirements through `doc(cfg())` attributes in the code (perhaps automatically derived from `cfg()` attributes in the not so distant future). With this it is not necessary to repeat the requirement in the documentation text once again, which wasn't really obvious nor good-looking to begin with. Besides, this "Feature:" text is currently erroneously generated on the last member of an enum, instead of on the enum itself (parts omitted for brevity): #[cfg(any(feature = "v1_14_1", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14_1")))] pub enum WebRTCFECType { /// none None, /// ulpfec + red /// /// Feature: `v1_14_1` /// UlpRed, }
The problem is that |
@GuillaumeGomez You mean this was just some nightly experiment that will disappear entirely? Will it be superseded by automatically detecting the feature from |
The goal is to make rustdoc aware of the |
@GuillaumeGomez That's really good news, but that still means the |
I'm not sure of what you mean. My point is that I'm worried that using an unstable feature might prevent users to generate doc locally or even break our crates' code. The update on rustdoc side will add it automatically depending on the |
That's already the case with the current docs. They only build with nightly. |
The unstable feature is already fully in use and docs (if In other words: if you want the textual |
Nowadays we have the
doc_cfg
feature rendering clean, consistent and obvious markers for feature requirements throughdoc(cfg())
attributes in the code (perhaps automatically derived fromcfg()
attributes in the not so distant future). With this it is not necessary to repeat the requirement in the documentation text once again, which wasn't really obvious nor good-looking to begin with.Besides, this "Feature:" text is currently erroneously generated on the last member of an enum, instead of on the enum itself (parts omitted for brevity):
Note that other documentation comments on the enum are correctly generated on the enum itself.