Skip to content

Commit 4a5bb0a

Browse files
authored
Merge pull request #673 from nicholasbishop/bishop-doc-unstable
xtask: Add `--unstable` option to `cargo xtask doc`
2 parents 118afe7 + cae8883 commit 4a5bb0a

File tree

6 files changed

+14
-5
lines changed

6 files changed

+14
-5
lines changed

.github/workflows/rust.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,12 @@ jobs:
9393
rustup component add clippy
9494
cargo xtask clippy --warnings-as-errors
9595
96-
- name: Run cargo doc
96+
- name: Run cargo doc (without unstable)
9797
run: cargo xtask doc --warnings-as-errors --document-private-items
9898

99+
- name: Run cargo doc (with unstable)
100+
run: cargo xtask doc --warnings-as-errors --document-private-items --unstable
101+
99102
- name: Verify generated code is up-to-date
100103
run: cargo xtask gen-code --check
101104

uefi/src/mem.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ use {core::alloc::Allocator, core::ptr::NonNull};
2929
/// `unstable`-feature, it uses the `allocator_api` instead. In that case, the function takes an
3030
/// additional parameter describing the specific [`Allocator`]. You can use [`alloc::alloc::Global`]
3131
/// as default.
32+
///
33+
/// [`Allocator`]: https://doc.rust-lang.org/alloc/alloc/trait.Allocator.html
34+
/// [`alloc::alloc::Global`]: https://doc.rust-lang.org/alloc/alloc/struct.Global.html
3235
pub(crate) fn make_boxed<
3336
'a,
3437
// The UEFI data structure.

uefi/src/proto/media/file/dir.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ impl Directory {
6060
})
6161
}
6262

63-
/// Wrapper around [`Self::read_entry_boxed_in`] that uses the [`Global`] allocator.
63+
/// Wrapper around [`Self::read_entry`] that returns an owned copy of the data. It has the same
64+
/// implications and requirements. On failure, the payload of `Err` is `()´.
6465
#[cfg(feature = "alloc")]
6566
pub fn read_entry_boxed(&mut self) -> Result<Option<Box<FileInfo>>> {
6667
let read_entry_res = self.read_entry(&mut []);

uefi/src/proto/media/file/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ pub trait File: Sized {
184184
(self.imp().flush)(self.imp()).into()
185185
}
186186

187-
/// Wrapper around [`Self::get_boxed_info_in`] that uses the [`Global`] allocator.
187+
/// Read the dynamically allocated info for a file.
188188
#[cfg(feature = "alloc")]
189189
fn get_boxed_info<Info: FileProtocolInfo + ?Sized + Debug>(&mut self) -> Result<Box<Info>> {
190190
let fetch_data_fn = |buf| self.get_info::<Info>(buf);

xtask/src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ fn doc(opt: &DocOpt) -> Result<()> {
9494
open: opt.open,
9595
document_private_items: opt.document_private_items,
9696
},
97-
// for all possible features
98-
features: Feature::more_code(true, true),
97+
features: Feature::more_code(*opt.unstable, true),
9998
packages: Package::published(),
10099
release: false,
101100
target: None,

xtask/src/opt.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ pub struct DocOpt {
112112
#[clap(long, action)]
113113
pub document_private_items: bool,
114114

115+
#[clap(flatten)]
116+
pub unstable: UnstableOpt,
117+
115118
#[clap(flatten)]
116119
pub warning: WarningOpt,
117120
}

0 commit comments

Comments
 (0)