Skip to content

Commit 236afa4

Browse files
jacksonbrimJonathanWoollett-Light
authored andcommitted
Enhance Docs: Add rustdoc-args & feature doc generation
* Add feature flag doc generation in lib.rs with auto_doc_cfg * Update Cargo.toml with rustdoc-args in [package.metadata.docs.rs] for docs.rs build. Local Doc Build Command: ``` RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features --open ``` Signed-off-by: Jackson Brim <[email protected]>
1 parent 2739a71 commit 236afa4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ codegen-units = 1
4444

4545
[package.metadata.docs.rs]
4646
all-features = true
47+
rustdoc-args = ["--cfg", "docsrs"]

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
//! without knowing the implementation details of the VM memory provider. Thus hypervisor
1616
//! components, such as boot loader, virtual device drivers, virtio backend drivers and vhost
1717
//! drivers etc, could be shared and reused by multiple hypervisors.
18-
1918
#![deny(clippy::doc_markdown)]
2019
#![deny(missing_docs)]
2120
#![deny(missing_debug_implementations)]
21+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2222

2323
// We only support 64bit. Fail build when attempting to build other targets
2424
#[cfg(not(target_pointer_width = "64"))]
@@ -64,6 +64,7 @@ mod mmap_windows;
6464

6565
#[cfg(feature = "backend-mmap")]
6666
pub mod mmap;
67+
6768
#[cfg(feature = "backend-mmap")]
6869
pub use mmap::{Error, GuestMemoryMmap, GuestRegionMmap, MmapRegion};
6970
#[cfg(all(feature = "backend-mmap", feature = "xen", unix))]

0 commit comments

Comments
 (0)