-
Notifications
You must be signed in to change notification settings - Fork 19
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
add doc(cfg(...))
to feature-flagged impls
#74
Conversation
Currently, feature-flagged public APIs will not be documented as requiring feature flags. This branch adds `#[doc(cfg(...))]` to all feature-flagged APIs. For the most part, this is done using the `feature!` macro lifted from Tokio: https://github.com/tokio-rs/tokio/blob/8943e8aeef0b33f371d6dc69f62b38da390b5d5f/tokio/src/macros/cfg.rs#L3-L14 In a couple of places, though, the feature-flagged thing is in a position other than item position, so in that case, it was necessary to just paste the attribute... Signed-off-by: Eliza Weisman <[email protected]>
@hawkw I don't think that this is necessary anymore as per this tweet. @taiki-e's PR (tokio-rs/tokio#4268) removed these feature flags. |
huh, i just built the docs on nightly yesterday and I thought I didn't see the feature flag docs, so I had thought that wasn't ready yet. let me double-check! |
@davidbarsky hmm, i'm still not seeing them without the attribute, on today's nightly: it looks like it worked for tokio, though. i wonder if the issue is that in |
@davidbarsky OH i'm a dumbass, it turns out --- we do still need to enable the |
huh. I still can't get it to work without the attributes, even with
|
that's effin' weird. anyways, ignore me! please don't let me nerdsnipe you on this shit |
Where we taking this? Moving forward or holding back? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way does not seem to work in some places.
As an alternative, I filed #80 that uses the way used in the tweet @davidbarsky mentioned.
feature! { | ||
#![feature = "alloc"] | ||
|
||
deref! { | ||
alloc::boxed::Box<T>, | ||
alloc::rc::Rc<T>, | ||
#[cfg(not(valuable_no_atomic_cas))] | ||
alloc::sync::Arc<T>, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, feature-flagged public APIs will not be documented as
requiring feature flags. This branch adds
#[doc(cfg(...))]
to allfeature-flagged APIs.
For the most part, this is done using the
feature!
macro lifted fromTokio:
https://github.com/tokio-rs/tokio/blob/8943e8aeef0b33f371d6dc69f62b38da390b5d5f/tokio/src/macros/cfg.rs#L3-L14
In a couple of places, though, the feature-flagged thing is in a
position other than item position, so in that case, it was necessary to
just paste the attribute...
Signed-off-by: Eliza Weisman [email protected]