Skip to content

Commit 0f2e94b

Browse files
committed
rustdoc cleanup: use rustdoc attribute
1 parent 1f4140d commit 0f2e94b

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

.github/workflows/rust.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ jobs:
117117
cargo xtask clippy --warnings-as-errors
118118
119119
- name: Run cargo doc
120-
run: cargo xtask doc --warnings-as-errors
120+
run: cargo xtask doc
121121

122122
miri:
123123
name: Run unit tests and doctests under Miri

src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
// Enable some additional warnings and lints.
3434
#![warn(clippy::ptr_as_ptr, missing_docs, unused)]
3535
#![deny(clippy::all)]
36+
#![deny(rustdoc::all)]
37+
// todo remove once https://github.com/rust-lang/rust/issues/101730 is stable
38+
#![feature(rustdoc_missing_doc_code_examples)]
39+
#![allow(rustdoc::missing_doc_code_examples)]
3640

3741
// `uefi-exts` requires access to memory allocation APIs.
3842
#[cfg(feature = "exts")]

uefi-macros/src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#![recursion_limit = "128"]
2+
#![deny(rustdoc::all)]
3+
// todo remove once https://github.com/rust-lang/rust/issues/101730 is stable
4+
#![feature(rustdoc_missing_doc_code_examples)]
5+
#![allow(rustdoc::missing_doc_code_examples)]
6+
7+
//! Code generation macros for the `uefi` crate.
28
39
extern crate proc_macro;
410

uefi-services/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
#![no_std]
2020
#![feature(alloc_error_handler)]
2121
#![feature(abi_efiapi)]
22+
#![deny(rustdoc::all)]
23+
// todo remove once https://github.com/rust-lang/rust/issues/101730 is stable
24+
#![feature(rustdoc_missing_doc_code_examples)]
25+
#![allow(rustdoc::missing_doc_code_examples)]
2226

2327
#[macro_use]
2428
extern crate log;

xtask/src/cargo.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ impl Cargo {
146146
}
147147
CargoAction::Doc { open } => {
148148
action = "doc";
149-
if self.warnings_as_errors {
150-
cmd.env("RUSTDOCFLAGS", "-Dwarnings");
151-
}
152149
if open {
153150
extra_args.push("--open");
154151
}
@@ -237,11 +234,11 @@ mod tests {
237234
packages: vec![Package::Uefi, Package::Xtask],
238235
release: false,
239236
target: None,
240-
warnings_as_errors: true,
237+
warnings_as_errors: false,
241238
};
242239
assert_eq!(
243240
command_to_string(&cargo.command().unwrap()),
244-
"RUSTDOCFLAGS=-Dwarnings cargo doc --package uefi --package xtask --features alloc --open"
241+
"cargo doc --package uefi --package xtask --features alloc --open"
245242
);
246243
}
247244
}

0 commit comments

Comments
 (0)