Skip to content

xtask: Add --unstable option to cargo xtask doc #673

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

Merged
merged 1 commit into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ jobs:
rustup component add clippy
cargo xtask clippy --warnings-as-errors

- name: Run cargo doc
- name: Run cargo doc (without unstable)
run: cargo xtask doc --warnings-as-errors --document-private-items

- name: Run cargo doc (with unstable)
run: cargo xtask doc --warnings-as-errors --document-private-items --unstable

- name: Verify generated code is up-to-date
run: cargo xtask gen-code --check

Expand Down
3 changes: 3 additions & 0 deletions uefi/src/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ use {core::alloc::Allocator, core::ptr::NonNull};
/// `unstable`-feature, it uses the `allocator_api` instead. In that case, the function takes an
/// additional parameter describing the specific [`Allocator`]. You can use [`alloc::alloc::Global`]
/// as default.
///
/// [`Allocator`]: https://doc.rust-lang.org/alloc/alloc/trait.Allocator.html
/// [`alloc::alloc::Global`]: https://doc.rust-lang.org/alloc/alloc/struct.Global.html
pub(crate) fn make_boxed<
'a,
// The UEFI data structure.
Expand Down
3 changes: 2 additions & 1 deletion uefi/src/proto/media/file/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ impl Directory {
})
}

/// Wrapper around [`Self::read_entry_boxed_in`] that uses the [`Global`] allocator.
/// Wrapper around [`Self::read_entry`] that returns an owned copy of the data. It has the same
/// implications and requirements. On failure, the payload of `Err` is `()´.
#[cfg(feature = "alloc")]
pub fn read_entry_boxed(&mut self) -> Result<Option<Box<FileInfo>>> {
let read_entry_res = self.read_entry(&mut []);
Expand Down
2 changes: 1 addition & 1 deletion uefi/src/proto/media/file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ pub trait File: Sized {
(self.imp().flush)(self.imp()).into()
}

/// Wrapper around [`Self::get_boxed_info_in`] that uses the [`Global`] allocator.
/// Read the dynamically allocated info for a file.
#[cfg(feature = "alloc")]
fn get_boxed_info<Info: FileProtocolInfo + ?Sized + Debug>(&mut self) -> Result<Box<Info>> {
let fetch_data_fn = |buf| self.get_info::<Info>(buf);
Expand Down
3 changes: 1 addition & 2 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ fn doc(opt: &DocOpt) -> Result<()> {
open: opt.open,
document_private_items: opt.document_private_items,
},
// for all possible features
features: Feature::more_code(true, true),
features: Feature::more_code(*opt.unstable, true),
packages: Package::published(),
release: false,
target: None,
Expand Down
3 changes: 3 additions & 0 deletions xtask/src/opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ pub struct DocOpt {
#[clap(long, action)]
pub document_private_items: bool,

#[clap(flatten)]
pub unstable: UnstableOpt,

#[clap(flatten)]
pub warning: WarningOpt,
}
Expand Down