bonsaidb icon indicating copy to clipboard operation
bonsaidb copied to clipboard

Enabling doc_auto_cfg to show feature flags

Open ecton opened this issue 3 years ago • 1 comments

This isn't perfect, but it's better than not having feature flags showing up at all. #178 explains the vision for where this will end-up after namespaced feature flags are released, and #174 can introduce a table of feature flags for each crate and link to #178.

ecton avatar Feb 06 '22 04:02 ecton

Well, I've decided to hold off on merging this. CI just needs to be swapped to nightly, silly oversight on my part.

The conundrum is this: The bonsaidb omnibus crate re-exports dependent crates based on what feature flags are activated. Each of those crates can be used independently, giving us a whole mess of feature flags which will be resolved by #178 eventually.

The exports are currently #[doc(inline)], which makes it so that when you go to https://docs.rs/bonsaidb and search for something, you can immediately find it across the entire omnibus crate. Currently this yields doc attributes being rendered at the exported location correctly, but the inlined items all omit their feature flag annotations (rustlang/rust#88743),

I was originally going to merge this with inlining disabled, but the documentation search feature is too critical. I'll probably go through and manually add notes in the documentation for the short term, as tedious as that will be.

ecton avatar Feb 06 '22 04:02 ecton