-
Notifications
You must be signed in to change notification settings - Fork 30
fix: use --cfg docsrs for document
#27
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
Conversation
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.
Pull request overview
This PR transitions from using --cfg doc to --cfg docsrs for documentation builds on docs.rs, following Rust's standard practice for conditional compilation during documentation generation. The change adds support for both doc and docsrs cfg flags in module definitions to ensure compatibility.
Key Changes:
- Updates
Cargo.tomlfiles to userustc-args = ["--cfg", "docsrs"]for docs.rs metadata and enablesall-features - Adds
docsrsalongsidedocin conditional compilation attributes for architecture-specific modules - Adds
#[cfg_attr(doc, doc(cfg(...)))]annotations to show platform-specific availability in documentation - Updates CI workflow to use
--cfg docsrsfor documentation builds
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
page_table_entry/Cargo.toml |
Updates docs.rs configuration to use docsrs flag and enables all features; adds docsrs to conditional dependencies |
page_table_entry/src/arch/mod.rs |
Adds docsrs to cfg conditions and adds doc(cfg(...)) attributes for platform documentation |
page_table_multiarch/Cargo.toml |
Updates docs.rs configuration to use docsrs flag and enables all features |
page_table_multiarch/tests/alloc_tests.rs |
Adds cfg attributes to architecture-specific tests (but missing docsrs flag) |
.github/workflows/ci.yml |
Updates doc job to use docsrs flag; adds comment for test workaround |
Cargo.lock |
Updates dependency versions (bit_field, bitflags, log, memory_addr, rand, rustversion, x86_64) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Note that the line |
|
The "dirty trick" mentioned in #26 (comment) does not work since the |
Azure-stars
left a comment
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.
LGTM.
This is an alternative to #26, applying the idea described in #26 (comment).