Seems this might be useful: > By adding #![feature(doc_cfg)] to the top of your lib.rs, any crate can get similar annotations for code guarded by #[cfg(...)]. via https://adventures.michaelfbryan.com/posts/bringing-include_dir-into-the-modern-era/