Skip to content

Commit 17ca2b0

Browse files
committed
Add doc_cfg for annotations on nightly
Signed-off-by: Joe Richey <[email protected]>
1 parent acfa59c commit 17ca2b0

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ cc = { version = "1.0.37", optional = true }
3737
default = [ "nightly", "instructions" ]
3838
instructions = []
3939
external_asm = [ "cc" ]
40-
nightly = [ "inline_asm", "const_fn", "abi_x86_interrupt" ]
40+
nightly = [ "inline_asm", "const_fn", "abi_x86_interrupt", "doc_cfg" ]
4141
inline_asm = []
4242
abi_x86_interrupt = []
4343
const_fn = []
44+
doc_cfg = []
4445

4546
[package.metadata.release]
4647
no-dev-version = true

src/instructions/interrupts.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ pub fn int3() {
153153
/// immediate. This macro will be replaced by a generic function when support for
154154
/// const generics is implemented in Rust.
155155
#[cfg(feature = "inline_asm")]
156-
#[cfg_attr(docsrs, doc(cfg(any(feature = "nightly", feature = "inline_asm"))))]
156+
#[cfg_attr(
157+
feature = "doc_cfg",
158+
doc(cfg(any(feature = "nightly", feature = "inline_asm")))
159+
)]
157160
#[macro_export]
158161
macro_rules! software_interrupt {
159162
($x:expr) => {{

src/instructions/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ pub fn bochs_breakpoint() {
5454
/// Gets the current instruction pointer. Note that this is only approximate as it requires a few
5555
/// instructions to execute.
5656
#[cfg(feature = "inline_asm")]
57-
#[cfg_attr(docsrs, doc(cfg(any(feature = "nightly", feature = "inline_asm"))))]
57+
#[cfg_attr(
58+
feature = "doc_cfg",
59+
doc(cfg(any(feature = "nightly", feature = "inline_asm")))
60+
)]
5861
#[inline(always)]
5962
pub fn read_rip() -> crate::VirtAddr {
6063
let rip: u64;

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#![cfg_attr(feature = "const_fn", feature(const_fn_trait_bound))] // PageSize marker trait
99
#![cfg_attr(feature = "inline_asm", feature(asm))]
1010
#![cfg_attr(feature = "abi_x86_interrupt", feature(abi_x86_interrupt))]
11-
#![cfg_attr(docsrs, feature(doc_cfg))]
11+
#![cfg_attr(feature = "doc_cfg", feature(doc_cfg))]
1212
#![warn(missing_docs)]
1313
#![deny(missing_debug_implementations)]
1414

0 commit comments

Comments
 (0)