-
Notifications
You must be signed in to change notification settings - Fork 755
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
Use doc_auto_cfg #1763
Use doc_auto_cfg #1763
Conversation
If we use `#![cfg_attr(docsrs, feature(doc_auto_cfg))]` instead of `#![cfg_attr(docsrs, feature(doc_cfg))]` we no longer need to manually mark types with `#[cfg_attr(docsrs, doc(cfg(feature = "std")))]`. Sweeeeeet.
I'm not really sure, if we do this we will need to check if any odd cfgs (like |
From my investigation just now it looks like this PR actually improves the situation. Build docs on master
Build docs on this branch
(Did not check other instances so there may be regressions elsewhere. I only checked this one and |
I'm surprised you are not more enthusiastic for this change, 100 lines of red in the diff coupled with less maintenance and never having to remember to add the additional attribute - seems like a big win to me. |
Note to self, if this merges we need to change #1127 to remove the attribute from |
Nice! I also suspected that it would improve the situation somehow, because surely we couldn't have gotten it all correct doing things by hand ... am glad to be proven correct. |
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.
ACK a189942
Cool, you've convinced me. |
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.
ACK a189942
If we use
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
instead of#![cfg_attr(docsrs, feature(doc_cfg))]
we no longer need to manually mark types with#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
.Sweeeeeet.
Props to pezcore for the lesson :)